Context-based intra prediction

ABSTRACT

A method for video processing is provided. The method includes performing downsampling on chroma and luma samples of a neighboring block of the current video block; determining, for a conversion between a current video block of a video that is a chroma block and a coded representation of the video, parameters of cross-component linear model (CCLM) based on the downsampled chroma and luma samples obtained from the downsampling; applying the CCLM on luma samples located in a luma block corresponding to the current video block to derive prediction values of the current video block; and performing the conversion based on the prediction values.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.16/987,670, filed on Aug. 7, 2020, which is a continuation ofInternational Application No. PCT/CN2019/123229 filed on Dec. 5, 2019which claims the priority to and benefit of International PatentApplication No. PCT/CN2018/119709, filed on Dec. 7, 2018,PCT/CN2018/125412, filed on Dec. 29, 2018, PCT/CN2019/070002, filed onJan. 1, 2019, PCT/CN2019/075874, filed on Feb. 22, 2019,PCT/CN2019/075993, filed on Feb. 24, 2019, PCT/CN2019/076195, filed onFeb. 26, 2019, PCT/CN2019/079396, filed on Mar. 24, 2019,PCT/CN2019/079431, filed on Mar. 25, 2019, PCT/CN2019/079769, filed onMar. 26, 2019. All the aforementioned applications are incorporated byreference in their entireties.

TECHNICAL FIELD

This patent document relates to video processing techniques, devices andsystems.

BACKGROUND

In spite of the advances in video compression, digital video stillaccounts for the largest bandwidth use on the internet and other digitalcommunication networks. As the number of connected user devices capableof receiving and displaying video increases, it is expected that thebandwidth demand for digital video usage will continue to grow.

SUMMARY

Devices, systems and methods related to digital video processing, andfor example, simplified linear model derivations for the cross-componentlinear model (CCLM) prediction mode in video coding are described. Thedescribed methods may be applied to both the existing video codingstandards (e.g., High Efficiency Video Coding (HEVC)) and future videocoding standards (e.g., Versatile Video Coding (VVC)) or codecs.

In one representative aspect, the disclosed technology may be used toprovide a method for video processing. The method includes determining,for a conversion between a current video block of a video that is achroma block and a coded representation of the video, parameters of across-component linear model based on two chroma samples from a group ofneighboring chroma samples, wherein the two chroma samples are selectedfrom the group based on a position rule; and performing the conversionbased on the determining.

In one representative aspect, the disclosed technology may be used toprovide a method for video processing. The method includes determining,for a conversion between a current video block of a video that is achroma block and a coded representation of the video, parameters of across-component linear model based on selected chroma samples based onpositions of the chroma samples, wherein the selected chroma samples areselected from a group of neighboring chroma samples, and performing theconversion based on the determining.

In another representative aspect, the disclosed technology may be usedto provide a method for video processing. The method includesdetermining, for a current video block, a group of neighboring chromasamples used to derive a set of values for parameters of a linear model,wherein a width and a height of the current video block is W and H,respectively, and wherein the group of neighboring chroma samplescomprises at least one sample that is located beyond 2×W aboveneighboring chroma samples or 2×H left neighboring chroma samples; andperforming, based on the linear model, a conversion between the currentvideo block and a coded representation of a video including the currentvideo block.

In another representative aspect, the disclosed technology may be usedto provide a method for video processing. The method includes:determining, for a conversion between a current video block of a videothat is a chroma block and a coded representation of the video, multiplesets of parameters, wherein each set of parameters defines across-component linear model (CCLM) and is derived from a correspondinggroup of chroma samples at corresponding chroma sample positions;determining, based on the multiple sets of parameters, parameters for afinal CCLM; and performing the conversion based on the final CCLM.

In another representative aspect, the disclosed technology may be usedto provide a method for video processing. The method includesdetermining, for a conversion between a current video block of a videoand a coded representation of the video, parameters of a cross-componentlinear model (CCLM) based on maximum and minimum values of chroma andluma samples of N groups of chroma and luma samples selected fromneighboring luma and chroma samples of the current video block; andperforming the conversion using the CCLM.

In another representative aspect, the disclosed technology may be usedto provide a method for video processing. The method includesdetermining, for a conversion between a current video block of a videothat is a chroma block and a coded representation of the video,parameters of a cross-component linear model that are completelydeterminable by two chroma samples and corresponding two luma samples;and performing the conversion based on the determining.

In another representative aspect, the disclosed technology may be usedto provide a method for video processing. The method includesdetermining, for a conversion between a current video block of a videothat is a chroma block and a coded representation of the video,parameters of a cross-component linear model using a parameter tablewhose entries are retrieved according to two chroma sample values andtwo luma sample values; and performing the conversion based on thedetermining.

In another representative aspect, the disclosed technology may be usedto provide a method for video processing. The method includesdetermining, for a conversion between a current video block of a videothat is a chroma block and a coded representation of the video, a finalprediction P(x, y) of a chroma sample at a position (x, y) in thecurrent video block as a combination of prediction results of multiplecross-component linear models (MCCLMs), wherein the MCCLMs are selectedbased on the position (x, y) of the chroma sample; and performing theconversion based on the final prediction.

In another representative aspect, the disclosed technology may be usedto provide a method for video processing. The method includesperforming, for a conversion between a current video block of a videothat is a chroma block and a coded representation of the video, a firstdetermination regarding whether a first cross-component linear model(CCLM) that uses only left-neighboring samples is used for predictingsamples of the current video block and/or a second determinationregarding whether a second cross-component linear model (CCLM) that usesonly above-neighboring samples is used for predicting samples of thecurrent video block; and performing the conversion based on the firstdetermination and/or the second determination.

In another representative aspect, the disclosed technology may be usedto provide a method for video processing. The method includesdetermining, for a conversion between a current video block of a videoand a coded representation of the video, a context that is used to codea flag using arithmetic coding in the coded representation of thecurrent video block, wherein the context is based on whether a top-leftneighboring block of the current video block is coded using across-component linear model (CCLM) prediction mode; and performing theconversion based on the determining, wherein the flag is signaled toindicate whether the CCLM prediction mode is applied on the currentvideo block, and wherein the CCLM prediction mode uses a linear mode toderive prediction values of a chroma component from another component.

In another representative aspect, the disclosed technology may be usedto provide a method for video processing. The method includesdetermining, for a conversion between a current video block of a videoand a coded representation of the video, a coding order for one or moreindications of a derived mode (DM mode) and a linear mode (LM mode)based on a coding mode of one or more neighboring blocks of the currentvideo block; and performing the conversion based on the determining,wherein the LE mode uses a linear mode to derive prediction values of achroma component from another component, and the DM mode derives intraprediction mode of a chroma component from another component.

In another representative aspect, the disclosed technology may be usedto provide a method for video processing. The method includesdetermining, for a conversion between a current video block of a videoand a coded representation of the video, parameters for a linear modelprediction or cross-color component prediction based on refinedneighboring luma samples and chroma samples of the current video block;deriving prediction values of a chroma component of the current videoblock based on the parameters and refined internal luma samples of thecurrent video block; and performing the conversion based on theprediction values.

In another representative aspect, the disclosed technology may be usedto provide a method for video processing. The method includesdetermining, for a conversion between a current video block of a videothat is a chroma block and a coded representation of the video,parameters for a linear model prediction or cross-color componentprediction based on by selecting neighboring samples based on a positionof a largest or a smallest neighboring sample; deriving predictionvalues of chroma samples of the current video block based on theparameters and internal luma samples of the current video block; andperforming the conversion based on the prediction values.

In another representative aspect, the disclosed technology may be usedto provide a method for video processing. The method includesdetermining, for a conversion between a current video block of a videoand a coded representation of the video, parameters for a linear modelprediction or cross-color component prediction based on a main colorcomponent and a dependent color component, the main color componentselected as one of a luma color component and a chroma color componentand the dependent color component selected as the other of the lumacolor component and the chroma color component; and performing theconversion based on the prediction values.

In another representative aspect, the disclosed technology may be usedto provide a method for video processing. The method comprises:performing downsampling on chroma and luma samples of a neighboringblock of the current video block; determining, for a conversion betweena current video block of a video that is a chroma block and a codedrepresentation of the video, parameters of cross-component linear model(CCLM) based on the downsampled chroma and luma samples obtained fromthe downsampling; applying the CCLM on luma samples located in a lumablock corresponding to the current video block to derive predictionvalues of the current video block; applying the CCLM on luma sampleslocated in a luma block corresponding to the current video block toderive prediction values of the current video block; and performing theconversion based on the prediction values.

In another representative aspect, the disclosed technology may be usedto provide a method for video processing. The method comprises:determining, for a conversion between a current video block of a videothat is a chroma block and a coded representation of the video,parameters of a cross-component linear model (CCLM) based on two or morechroma samples from a group of neighboring chroma samples, wherein thetwo or more chroma samples are selected based on a coding mode of thecurrent video block; and performing the conversion based on thedetermining.

In another representative aspect, the disclosed technology may be usedto provide a method for video processing. The method comprises:determining, for a conversion between a current video block of a videothat is a chroma block and a coded representation of the video,parameters of cross-component linear model (CCLM) based on chromasamples that are selected based on W available above-neighboringsamples, W being an integer; and performing the conversion based on thedetermining.

In another representative aspect, the disclosed technology may be usedto provide a method for video processing. The method comprises:determining, for a conversion between a current video block of a videothat is a chroma block and a coded representation of the video,parameters of cross-component linear model (CCLM) based on chromasamples that are selected based on H available left-neighboring samplesof the current video block; and performing the conversion based on thedetermining.

In another representative aspect, the disclosed technology may be usedto provide a method for video processing. The method comprises:determining, for a conversion between a current video block of a videothat is a chroma block and a coded representation of the video,parameters of a cross-component linear model (CCLM) based on two or fourchroma samples and/or corresponding luma samples; and performing theconversion based on the determining.

In another representative aspect, the disclosed technology may be usedto provide a method for video processing. The method comprises:selecting, for a conversion between a current video block of a videothat is a chroma block and a coded representation of the video, chromasamples based on a position rule, the chroma samples used to deriveparameters of a cross-component linear model (CCLM); and performing theconversion based on the determining, wherein the position rule specifiesto select the chroma samples that are located within an above row and/ora left column of the current video block.

In another representative aspect, the disclosed technology may be usedto provide a method for video processing. The method comprises:determining, for a conversion between a current video block of a videothat is a chroma block and a coded representation of the video,positions at which luma samples are downsampled, wherein the downsampledluma samples are used to determine parameters of a cross-componentlinear model (CCLM) based on chroma samples and downsampled lumasamples, wherein the downsampled luma samples are at positionscorresponding to positions of the chroma samples that are used to derivethe parameters of the CCLM; and performing the conversion based on thedetermining.

In another representative aspect, the disclosed technology may be usedto provide a method for video processing. The method comprises:determining, for a conversion between a current video block of a videothat is a chroma block and a coded representation of the video, a methodto derive parameters of a cross-component linear model (CCLM) usingchroma samples and luma samples based on a coding condition associatedwith the current video block; and performing the conversion based on thedetermining.

In another representative aspect, the disclosed technology may be usedto provide a method for video processing. The method comprises:determining, for a conversion between a current video block of a videothat is a chroma block and a coded representation of the video, whetherto derive maximum values and/or minimum values of a luma component and achroma component that are used to derive parameters of a cross-componentlinear model (CCLM) based on availability of a left-neighboring blockand an above-neighboring block of the current video block; andperforming the conversion based on the determining.

In another representative aspect, the disclosed technology may be usedto provide a method for video processing. The method comprisesdetermining, for a conversion between a current video block of a videoand a coded representation of the video, parameters of a coding toolusing a linear model based on selected neighboring samples of thecurrent video block and corresponding neighboring samples of a referenceblock; and performing the conversion based on the determining.

In another representative aspect, the disclosed technology may be usedto provide a method for video processing. The method comprises:determining, for a conversion between a current video block of a videoand a coded representation of the video, parameters of a localillumination compensation (LIC) tool based on N neighboring samples ofthe current video block and N corresponding neighboring samples of areference block, wherein the N neighboring samples of the current videoblock are selected based on positions of the N neighboring samples; andperforming the conversion based on the determining, wherein the LIC tooluses a linear model of illumination changes in the current video blockduring the conversion.

In another representative aspect, the disclosed technology may be usedto provide a method for video processing. The method comprisesdetermining, for a conversion between a current video block of a videothat is a chroma block and a coded representation of the video,parameters of a cross-component linear model (CCLM) based on chromasamples and corresponding luma samples; and performing the conversionbased on the determining, wherein some of the chroma samples areobtained by a padding operation and the chroma samples and thecorresponding luma samples are grouped into two arrays G0 and G1, eacharray including two chroma samples and corresponding luma samples.

In yet another representative aspect, the above-described method isembodied in the form of processor-executable code and stored in acomputer-readable program medium.

In yet another representative aspect, a device that is configured oroperable to perform the above-described method is disclosed. The devicemay include a processor that is programmed to implement this method.

In yet another representative aspect, a video decoder apparatus mayimplement a method as described herein.

The above and other aspects and features of the disclosed technology aredescribed in greater detail in the drawings, the description and theclaims.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows an example of locations of samples used for the derivationof the weights of the linear model used for cross-component prediction.

FIG. 2 shows an example of classifying neighboring samples into twogroups.

FIG. 3A shows an example of a chroma sample and its corresponding lumasamples.

FIG. 3B shows an example of down filtering for the cross-componentlinear model (CCLM) in the Joint Exploration Model (JEM).

FIGS. 4A and 4B show examples of only top-neighboring and onlyleft-neighboring samples used for prediction based on a linear model,respectively.

FIG. 5 shows an example of a straight line between minimum and maximumluma values as a function of the corresponding chroma samples.

FIG. 6 shows an example of a current chroma block and its neighboringsamples.

FIG. 7 shows an example of different parts of a chroma block predictedby a linear model using only left-neighboring samples (LM-L) and alinear model using only above-neighboring samples (LM-A).

FIG. 8 shows an example of a top-left neighboring block.

FIG. 9 shows an example of samples to be used to derive a linear model.

FIG. 10 shows an example of left and below-left columns and above andabove-right rows relative to a current block.

FIG. 11 shows an example of a current block and its reference samples.

FIG. 12 shows examples of two neighboring samples when both left andabove neighboring reference samples are available.

FIG. 13 shows examples of two neighboring samples when only aboveneighboring reference samples are available.

FIG. 14 shows examples of two neighboring samples when only leftneighboring reference samples are available.

FIG. 15 shows examples of four neighboring samples when both left andabove neighboring reference samples are available.

FIG. 16 shows an example of lookup tables used in LM derivations.

FIG. 17 shows an example of an LM parameter derivation process with 64entries.

FIG. 18 shows a flowchart of an example method for video processingbased on some implementations of the disclosed technology.

FIGS. 19A and 19B show flowcharts of example methods for videoprocessing based on some implementations of the disclosed technology.

FIGS. 20A and 20B show flowcharts of another example methods for videoprocessing based on some implementations of the disclosed technology.

FIG. 21 shows a flowchart of another example method for video processingbased on some implementations of the disclosed technology.

FIG. 22 shows a flowchart of an example method for video processingbased on some implementations of the disclosed technology.

FIGS. 23A and 23B show flowcharts of example methods for videoprocessing based on some implementations of the disclosed technology.

FIGS. 24A-24E show flowcharts of example methods for video processingbased on some implementations of the disclosed technology.

FIGS. 25A and 25B show flowcharts of example methods for videoprocessing based on some implementations of the disclosed technology.

FIGS. 26A and 26B show flowcharts of example methods for videoprocessing based on some implementations of the disclosed technology.

FIGS. 27A and 27B show flowcharts of example methods for videoprocessing based on some implementations of the disclosed technology.

FIGS. 28A-28C show flowcharts of example methods for video processingbased on some implementations of the disclosed technology.

FIGS. 29A-29C show flowcharts of example methods for video processingbased on some implementations of the disclosed technology.

FIGS. 30A and 30B are block diagrams of examples of hardware platformsfor implementing a visual media decoding or a visual media encodingtechnique described in the present document.

FIGS. 31A and 31B show examples of LM parameter derivation process withfour entries. FIG. 31A shows an example when both above and leftneighboring samples are available and FIG. 31B shows an example whenonly above neighboring samples are available and top-right is notavailable.

FIG. 32 shows examples of neighboring samples to derive LIC parameters.

DETAILED DESCRIPTION

Due to the increasing demand of higher resolution video, video codingmethods and techniques are ubiquitous in modern technology. Video codecstypically include an electronic circuit or software that compresses ordecompresses digital video, and are continually being improved toprovide higher coding efficiency. A video codec converts uncompressedvideo to a compressed format or vice versa. There are complexrelationships between the video quality, the amount of data used torepresent the video (determined by the bit rate), the complexity of theencoding and decoding algorithms, sensitivity to data losses and errors,ease of editing, random access, and end-to-end delay (latency). Thecompressed format usually conforms to a standard video compressionspecification, e.g., the High Efficiency Video Coding (HEVC) standard(also known as H.265 or MPEG-H Part 2), the Versatile Video Coding (VVC)standard to be finalized, or other current and/or future video codingstandards.

Embodiments of the disclosed technology may be applied to existing videocoding standards (e.g., HEVC, H.265) and future standards to improveruntime performance. Section headings are used in the present documentto improve readability of the description and do not in any way limitthe discussion or the embodiments (and/or implementations) to therespective sections only.

1 Embodiments of Cross-Component Prediction

Cross-component prediction is a form of the chroma-to-luma predictionapproach that has a well-balanced trade-off between complexity andcompression efficiency improvement.

1.1 Examples of the Cross-Component Linear Model (CCLM)

In some embodiments, and to reduce the cross-component redundancy, across-component linear model (CCLM) prediction mode (also referred to asLM), is used in the JEM, for which the chroma samples are predictedbased on the reconstructed luma samples of the same CU by using a linearmodel as follows:pred_(C)(i,j)=α·rec_(L)′(i,j)+β  (1)

Here, pred_(C)(i,j) represents the predicted chroma samples in a CU andrec_(L)′(i,j) represents the downsampled reconstructed luma samples ofthe same CU for color formats 4:2:0 or 4:2:2 while rec_(L)′(i,j)represents the reconstructed luma samples of the same CU for colorformat 4:4:4. CCLM parameters α and β are derived by minimizing theregression error between the neighboring reconstructed luma and chromasamples around the current block as follows:

$\begin{matrix}{\alpha = {\frac{{N \cdot {\sum\left( {{L(n)} \cdot {C(n)}} \right)}} - {\sum{{L(n)} \cdot {\sum{C(n)}}}}}{{N \cdot {\sum\left( {{L(n)} \cdot {L(n)}} \right)}} - {\sum{{L(n)} \cdot {\sum{L(n)}}}}}{and}}} & (2)\end{matrix}$ $\begin{matrix}{\beta = {\frac{{\sum{C(n)}} - {\alpha \cdot {\sum{L(n)}}}}{N}.}} & (3)\end{matrix}$

Here, L(n) represents the down-sampled (for color formats 4:2:0 or4:2:2) or original (for color format 4:4:4) top and left neighboringreconstructed luma samples, C(n) represents the top and left neighboringreconstructed chroma samples, and value of N is equal to twice of theminimum of width and height of the current chroma coding block.

In some embodiments, and for a coding block with a square shape, theabove two equations are applied directly. In other embodiments, and fora non-square coding block, the neighboring samples of the longerboundary are first subsampled to have the same number of samples as forthe shorter boundary. FIG. 1 shows the location of the left and abovereconstructed samples and the sample of the current block involved inthe CCLM mode.

In some embodiments, this regression error minimization computation isperformed as part of the decoding process, not just as an encoder searchoperation, so no syntax is used to convey the α and β values.

In some embodiments, the CCLM prediction mode also includes predictionbetween the two chroma components, e.g., the Cr (red-difference)component is predicted from the Cb (blue-difference) component. Insteadof using the reconstructed sample signal, the CCLM Cb-to-Cr predictionis applied in residual domain. This is implemented by adding a weightedreconstructed Cb residual to the original Cr intra prediction to formthe final Cr prediction:pred_(Cr)*(i,j)=pred_(Cr)(i,j)+α·resi_(Cb)′(i,j)  (4)

Here, resi_(Cb)′(i,j) presents the reconstructed Cb residue sample atposition (i,j).

In some embodiments, the scaling factor α may be derived in a similarway as in the CCLM luma-to-chroma prediction. The only difference is anaddition of a regression cost relative to a default α value in the errorfunction so that the derived scaling factor is biased towards a defaultvalue of −0.5 as follows:

$\begin{matrix}{\alpha = \frac{{N \cdot {\sum\left( {{{Cb}(n)} \cdot {{Cr}(n)}} \right)}} - {\sum{{{Cb}(n)} \cdot {\sum{{Cr}(n)}}}} + {\lambda \cdot \left( {- 0.5} \right)}}{{N \cdot {\sum\left( {{{Cb}(n)} \cdot {{Cb}(n)}} \right)}} - {\sum{{{Cb}(n)} \cdot {\sum{{Cb}(n)}}}} + \lambda}} & (5)\end{matrix}$

Here, C b (n) represents the neighboring reconstructed Cb samples, C r(n) represents the neighboring reconstructed Cr samples, and λ is equalto Σ(Cb(n)·Cb(n))>>9.

In some embodiments, the CCLM luma-to-chroma prediction mode is added asone additional chroma intra prediction mode. At the encoder side, onemore RD cost check for the chroma components is added for selecting thechroma intra prediction mode. When intra prediction modes other than theCCLM luma-to-chroma prediction mode is used for the chroma components ofa CU, CCLM Cb-to-Cr prediction is used for Cr component prediction.

1.2 Examples of Multiple Model CCLM

In the JEM, there are two CCLM modes: the single model CCLM mode and themultiple model CCLM mode (MMLM). As indicated by the name, the singlemodel CCLM mode employs one linear model for predicting the chromasamples from the luma samples for the whole CU, while in MMLM, there canbe two models.

In MMLM, neighboring luma samples and neighboring chroma samples of thecurrent block are classified into two groups, each group is used as atraining set to derive a linear model (i.e., a particular α and β arederived for a particular group). Furthermore, the samples of the currentluma block are also classified based on the same rule for theclassification of neighboring luma samples.

FIG. 2 shows an example of classifying the neighboring samples into twogroups. Threshold is calculated as the average value of the neighboringreconstructed luma samples. A neighboring sample withRec′_(L)[x,y]<=Threshold is classified into group 1; while a neighboringsample with Rec′_(L)[x,y]>Threshold is classified into group 2.

$\begin{matrix}\left\{ {\begin{matrix}{{{Pred}_{c}\left\lbrack {x,y} \right\rbrack} = {{\alpha_{1} \times {{Rec}_{L}^{\prime}\left\lbrack {x,y} \right\rbrack}} + \beta_{1}}} & {{{if}{{Rec}_{L}^{\prime}\left\lbrack {x,y} \right\rbrack}} \leq {Threshold}} \\{{{Pred}_{c}\left\lbrack {x,y} \right\rbrack} = {{\alpha_{2} \times {{Rec}_{L}^{\prime}\left\lbrack {x,y} \right\rbrack}} + \beta_{2}}} & {{{if}{{Rec}_{L}^{\prime}\left\lbrack {x,y} \right\rbrack}} > {Threshold}}\end{matrix}} \right. & {(6)}\end{matrix}$1.3 Examples of Downsampling Filters in CCLM

In some embodiments, and to perform cross-component prediction, for the4:2:0 chroma format, where 4 luma samples corresponds to 1 chromasamples, the reconstructed luma block needs to be downsampled to matchthe size of the chroma signal. The default downsampling filter used inCCLM mode is as follows:

$\begin{matrix}{{{Rec}_{L}^{\prime}\left\lbrack {x,y} \right\rbrack} = {\left\{ {{2 \times {{Rec}_{L}\left\lbrack {{2x},{2y}} \right\rbrack}} + {2 \times {{Rec}_{L}\left\lbrack {{2x},{{2y} + 1}} \right\rbrack}} + {{Rec}_{L}\left\lbrack {{{2x} - 1},{2y}} \right\rbrack} + {{Rec}_{L}\left\lbrack {{{2x} + 1},{2y}} \right\rbrack} + {{Rec}_{L}\left\lbrack {{{2x} - 1},{{2y} + 1}} \right\rbrack} + {{Rec}_{L}\left\lbrack {{{2x} + 1},{{2y} + 1}} \right\rbrack} + 4} \right\} \gg 3}} & (7)\end{matrix}$

Here, the downsampling assumes the “type 0” phase relationship as shownin FIG. 3A for the positions of the chroma samples relative to thepositions of the luma samples, e.g., collocated sampling horizontallyand interstitial sampling vertically.

The exemplary 6-tap downsampling filter defined in (6) is used as thedefault filter for both the single model CCLM mode and the multiplemodel CCLM mode.

In some embodiments, and for the MMLM mode, the encoder canalternatively select one of four additional luma downsampling filters tobe applied for prediction in a CU, and send a filter index to indicatewhich of these is used. The four selectable luma downsampling filtersfor the MMLM mode, as shown in FIG. 3B, are as follows:

$\begin{matrix}{{{Rec}_{L}^{\prime}\left\lbrack {x,y} \right\rbrack} = {\left( {{{Rec}_{L}\left\lbrack {{2x},{2y}} \right\rbrack} + {{Rec}_{L}\left\lbrack {{{2x} + 1},{2y}} \right\rbrack} + 1} \right) \gg 1}} & (8)\end{matrix}$ $\begin{matrix}{{{Rec}_{L}^{\prime}\left\lbrack {x,y} \right\rbrack} = {\left( {{{Rec}_{L}\left\lbrack {{{2x} + 1},{2y}} \right\rbrack} + {{Rec}_{L}\left\lbrack {{{2x} + 1},{{2y} + 1}} \right\rbrack} + 1} \right) \gg 1}} & (9)\end{matrix}$ $\begin{matrix}{{{Rec}_{L}^{\prime}\left\lbrack {x,y} \right\rbrack} = {\left( {{{Rec}_{L}\left\lbrack {{2x},{{2y} + 1}} \right\rbrack} + {{Rec}_{L}\left\lbrack {{{2x} + 1},{{2y} + 1}} \right\rbrack} + 1} \right) \gg 1}} & (10)\end{matrix}$ $\begin{matrix}{{{Rec}_{L}^{\prime}\left\lbrack {x,y} \right\rbrack} = {\left( {{{Rec}_{L}\left\lbrack {{2x},{2y}} \right\rbrack} + {{Rec}_{L}\left\lbrack {{2x},{{2y} + 1}} \right\rbrack} + {{Rec}_{L}\left\lbrack {{{2x} + 1},{2y}} \right\rbrack} + {{Rec}_{L}\left\lbrack {{{2x} + 1},{{2y} + 1}} \right\rbrack} + 2} \right) \gg 2}} & (11)\end{matrix}$1.4 Multi-Directional LM (MDLM)

This existing implementation proposes multi-directional LM (MDLM). InMDLM, two additional CCLM modes are proposed: LM-A, where the linearmodel parameters are derived only based on the top-neighboring (orabove-neighboring) samples as shown in FIG. 4A, and LM-L, where thelinear model parameters are derived only based on the left-neighboringsamples as shown in FIG. 4B.

1.5 Cross-Component Linear Model Simplification

This existing implementation proposes to replace the LMS algorithm ofthe linear model parameters α and β by a straight line equation, socalled two-point method. The 2 points (couple of Luma and Chroma) (A, B)are the minimum and maximum values inside the set of neighboring Lumasamples as depicted in FIG. 5 .

Herein, the linear model parameters α and β are obtained according tothe following equation:

$\alpha = {{\frac{y_{B} - y_{A}}{x_{B} - x_{A}}{and}\beta} = {y_{A} - {\alpha{x_{A}.}}}}$

In some embodiments, the division operation needed in the derivation ofa is avoided and replaced by multiplications and shifts as below:a=0;iShift=16;int shift=(uiInternalBitDepth>8)?uiInternalBitDepth−9:0;int add=shift?1<<(shift−1):0;int diff=(MaxLuma−MinLuma+add)>>shift;if(diff>0)

{int div=((MaxChroma−MinChroma)*g_aiLMDivTableLow[diff−1]+32768)>>16;a=(((MaxChroma−MinChroma)*g_aiLMDivTableHigh[diff−1]+div+add)>>shift);

}b=MinLuma[1]−((a*MinLuma[0])>>iShift);

Herein, S is set equal to iShift, α is set equal to a and β is set equalto b. Furthermore, g_aiLMDivTableLow and g_aiLMDivTableHigh are twotables each with 512 entries, wherein each entry stores a 16-bitinteger.

To derive the chroma predictor, as for the current VTM implementation,the multiplication is replaced by an integer operation as the following:

pred_(C)(i, j) = (α ⋅ rec_(L)^(′(i, j))) ≫ S + β

This implementation is also simpler than the current VTM implementationbecause shift S always has the same value.

1.6 Examples of CCLM in VVC

CCLM as in JEM is adopted in VTM-2.0, but MM-CCLM in JEM is not adoptedin VTM-2.0. MDLM and simplified CCLM have been adopted into VTM-3.0.

1.7 Examples of Local Illumination Compensation in JEM

Local Illumination Compensation (LIC) is based on a linear model forillumination changes, using a scaling factor a and an offset b. And itis enabled or disabled adaptively for each inter-mode coded coding unit(CU).

When LIC applies for a CU, a least square error method is employed toderive the parameters a and b by using the neighbouring samples of thecurrent CU and their corresponding reference samples. More specifically,as illustrated in FIG. 32 , the subsampled (2:1 subsampling)neighbouring samples of the CU and the corresponding pixels (identifiedby motion information of the current CU or sub-CU) in the referencepicture are used. The IC parameters are derived and applied for eachprediction direction separately.

When a CU is coded with 2N×2N merge mode, the LIC flag is copied fromneighbouring blocks, in a way similar to motion information copy inmerge mode; otherwise, an LIC flag is signalled for the CU to indicatewhether LIC applies or not.

When LIC is enabled for a picture, additional CU level RD check isneeded to determine whether LIC is applied or not for a CU. When LIC isenabled for a CU, mean-removed sum of absolute difference (MR-SAD) andmean-removed sum of absolute Hadamard-transformed difference (MR-SATD)are used, instead of SAD and SATD, for integer pel motion search andfractional pel motion search, respectively.

To reduce the encoding complexity, the following encoding scheme isapplied in JEM: LIC is disabled for the entire picture when there is noobvious illumination change between a current picture and its referencepictures. To identify this situation, histograms of a current pictureand every reference picture of the current picture are calculated at theencoder. If the histogram difference between the current picture andevery reference picture of the current picture is smaller than a giventhreshold, LIC is disabled for the current picture; otherwise, LIC isenabled for the current picture.

2 Examples of Drawbacks in Existing Implementations

Current implementations introduce a two-point method to replace the LMSapproach of LM mode in JEM. Although the new method decreases the numberof additions and multiplications in CCLM, it introduces the followingproblems:

1) Comparisons are introduced to find the minimum and maximum lumavalues, which are not friendly to a single instruction, multiple data(SIMD) software design.

2) Two lookup-tables with 1024 entries in total storing 16-bit numbersare introduced, with a 2K ROM memory requirement that is not desirablein a hardware design.

3 Exemplary Methods for Cross-Component Prediction in Video Coding

Embodiments of the presently disclosed technology overcome drawbacks ofexisting implementations, thereby providing video coding with highercoding efficiencies and lower computational complexity. Simplifiedlinear model derivations for cross-component prediction, based on thedisclosed technology, may enhance both existing and future video codingstandards, is elucidated in the following examples described for variousimplementations. The examples of the disclosed technology provided belowexplain general concepts, and are not meant to be interpreted aslimiting. In an example, unless explicitly indicated to the contrary,the various features described in these examples may be combined.

In the following examples and methods, the term “LM method” includes,but is not limited to, the LM mode in JEM or VTM, and MMLM mode in JEM,left-LM mode which only uses left neighboring samples to derive thelinear model, the above-LM mode which only uses above neighboringsamples to derive the linear model or other kinds of methods whichutilize luma reconstruction samples to derive chroma prediction blocks.All LM modes which are not the LM-L nor the LM-A are called normal LMmodes.

In the following examples and methods, Shift(x, s) is defined asShift(x,s)=(x+off)»s, and SignShift(x, s) is defined as

${{SignShift}\left( {x,s} \right)} = \left\{ \begin{matrix}{\left( {x + {off}} \right) \gg s} & {x \geq 0} \\{- \left( {\left( {{- x} + {off}} \right) \gg s} \right.} & {x < 0}\end{matrix} \right.$

Herein, off is an integer such as 0 or 2^(s-1).

The height and width of a current chroma block are denoted H and W,respectively.

FIG. 6 shows an example of neighboring samples of the current chromablock. Let the coordinate of the top-left sample of the current chromablock be denoted as (x, y). Then, the neighboring chroma samples (asshown in FIG. 6 ) are denoted as:

A: Top sample at left: [x−1, y],

B: Top middle sample at left: [x−1, y+H/2−1],

C: Bottom middle sample at left: [x−1, y+H/2],

D: Bottom sample at left: [x−1, y+H−1],

E: Extended-bottom top sample at left: [x−1, y+H],

F: Extended-bottom top middle sample at left: [x−1, y+H+H/2−1],

G: Extended-bottom bottom middle sample at left: [x−1, y+H+H/2],

I: Extended-bottom bottom sample at left: [x−1, y+H+H−1],

J: Left sample at above: [x, y−1],

K: Left middle sample at above: [x+W/2−1, y−1],

L: Right middle sample at above: [x+W/2, y−1],

M: Right sample at above: [x+W−1, y−1],

N: Extended-above left sample at above: [x+W, y−1],

O: Extended-above left middle sample at above: [x+W+W/2−1, y−1],

P: Extended-above right middle sample at above: [x+W+W/2, y−1], and

Q: Extended-above right sample at above: [x+W+W−1, y−1].

Example 1

The parameters α and β in LM methods are derived from chroma samples attwo or more specific positions.

-   -   a. The derivation is also dependent on the corresponding        down-sampled luma samples of selected chroma samples.        Alternatively, the derivation is also dependent on the        corresponding luma samples of selected chroma samples such as        when it is 4:4:4 color format.    -   b. For example, the parameters α and β in CCLM are derived from        chroma samples at 2^(S) (e.g. S=2 or 3) positions, such as:        -   i. Position {A, D, J, M};        -   ii. Position {A, B, C, D, J, K, L, M};        -   iii. Position {A, I, J, Q};        -   iv. Position {A, B, D, I, J, K, M, Q};        -   v. Position {A, B, D, F, J, K, M, O};        -   vi. Position {A, B, F, I, J, K, O, Q};        -   vii. Position {A, C, E, I, J, L, N, Q};        -   viii. Position {A, C, G, I, J, L, P, Q};        -   ix. Position {A, C, E, G, J, L, N, P};        -   x. Position {A, B, C, D};        -   xi. Position {A, B, D, I};        -   xii. Position {A, B, D, F};        -   xiii. Position {A, C, E, I};        -   xiv. Position {A, C, G, I};        -   xv. Position {A, C, E, G};        -   xvi. Position {J, K, L, M};        -   xvii. Position {J, K, M, Q};        -   xviii. Position {J, K, M, O};        -   xix. Position {J, K, O, Q};        -   xx. Position {J, L, N, Q};        -   xxi. Position {J, L, P, Q};        -   xxii. Position {J, L, N, P};        -   xxiii. Position {A, B, C, E, E, F, G, I};        -   xxiv. Position {J, K, L, M, N, O, P, Q};    -   c. For example, the parameters α and β in CCLM are derived from        chroma samples at:        -   i. Any combination between {A, B, C, D, E, F, G, I} and {J,            K, L, M, N, O, P, Q} such as            -   (a) Position A and J;            -   (b) Position B and K;            -   (c) Position C and L;            -   (d) Position D and M;            -   (e) Position E and N;            -   (f) Position F and O;            -   (g) Position G and P;            -   (h) Position I and Q;        -   ii. Any two different positions fetched from {A, B, C, D, E,            F, G,}            -   (a) Position A and B;            -   (b) Position A and C;            -   (c) Position A and D;            -   (d) Position A and E;            -   (e) Position A and F;            -   (f) Position A and G;            -   (g) Position A and I;            -   (h) Position D and B;            -   (i) Position D and C;            -   (j) Position E and B;            -   (k) Position E and C;            -   (l) Position I and B;            -   (m) Position I and C;            -   (n) Position I and D;            -   (o) Position I and E;            -   (p) Position I and F;            -   (q) Position I and G;        -   iii. Any two different positions fetched from {J, K, L, M,            N, O, P, Q}            -   (a) Position J and K;            -   (b) Position J and L;            -   (c) Position J and M;            -   (d) Position J and N;            -   (e) Position J and O;            -   (f) Position J and P;            -   (g) Position J and Q;            -   (h) Position M and K;            -   (i) Position M and L;            -   (j) Position N and K;            -   (k) Position N and L;            -   (l) Position Q and K;            -   (m) Position Q and L;            -   (n) Position Q and M;            -   (o) Position Q and N;            -   (p) Position Q and O;            -   (q) Position Q and P;            -   (r) Position Q and Q;        -   iv. In one example, if the two selected positions have            identical luma value, more positions may be further checked.    -   d. For example, not all available chroma samples are searched to        find the minimum and maximum luma values to derive the        parameters α and β in CCLM with the two-point method.        -   i. One chroma sample out of K chroma samples (and their            corresponding down-sampled luma samples) are included in the            searching set. K may be 2, 4, 6 or 8.            -   (a) For example, if Rec[x,y] is an above neighboring                sample, it is included in the searching set only if x %                K==0. If Rec[x,y] is a left neighboring sample, it is                included in the searching set only if y % K==0.        -   ii. Only Chroma samples at specific positions such as            defined in            -   1.a.i˜1.a.xxiv are included in the searching set.    -   e. For mode LM-L, all selected samples must be left-neighboring        samples.    -   f. For mode LM-A, all selected samples must be above-neighboring        samples.    -   g. The selected positions can be fixed, or they can be adaptive.        -   i. In one example, which positions are selected may depend            on the width and height of the current chroma block;        -   ii. In one example, which positions are selected may be            signaled from the encoder to the decoder, such as in            VPS/SPS/PPS/slice header/tile group header/tile/CTU/CU/PU.    -   h. The selected chroma samples are used to derive the parameters        α and β with the least mean square method as shown in Eq(2) and        Eq(3). In Eq(2) and Eq(3), N is set to be the number of the        selected samples.    -   i. A pair of selected chroma samples are used to derive the        parameters α and (3 with the two-point method.    -   j. In one example, how to select samples may depend on the        availability of the neighboring blocks.        -   i. For example, positions A, D, J and M are selected if both            the left and the above neighboring blocks are available;            position A and D are selected if only the left neighboring            block is available; and position J and M are selected if            only the above neighboring block is available.

Example 2

Sets of parameters in CCLM mode can be firstly derived and then combinedto form the final linear model parameter used for coding one block.Suppose α₁ and β₁ are derived from a group of chroma samples at specificpositions denoted as Group 1, α₂ and β₂ are derived from a group ofchroma samples at specific positions denoted as Group 2, . . . , α_(N)and β_(N) are derived from a group of chroma samples at specificpositions denoted as Group N, then the final α and β can be derived from(α₁, β₁), . . . (α_(N), β_(N)).

-   -   a. In one example, α is calculated as the average of α₁, . . .        α_(N) and β is calculated as the average of β₁, . . . β_(N).        -   i. In one example, α=SignShift(α₁+α₂, 1), β=SignShift(β₁+β₂,            1).        -   ii. In one example, α=Shift(α₁+α₂, 1), β=Shift(β₁+β₂, 1).        -   iii. If (α₁, β₁) and (α₂, β₂) are with different precision,            for example, To get a chroma prediction CP from its            corresponding down-sampled luma sample LR, it is calculated            as            CP=SignShift(α₁ ×LR+β ₁ ,Sh ₁) with (α₁, β₁), but            CP=SignShift(α₂ ×LR+β ₂ ,Sh ₂) with (α₂, β₂)        -    Sh₁ is not equal to Sh₂, then the parameters need to be            shifted before being combined. Suppose Sh₁>Sh₂, then before            combining, the parameters should be shifted as:            -   (a) α₁=SignShift(α₁,Sh₁−Sh₂), β₁=SignShift(β₁,Sh₁−Sh₂).                Then the final precision is as (α₂, β₂).            -   (b) α₁=Shift (α₁, Sh₁−Sh₂), β₁=shift (β₁, Sh₁−Sh₂). Then                the final precision is as (α₂, β₂).            -   (c) α₂=α<<(Sh₁−Sh₂), β₂=β₂<<(Sh₁−Sh₂). Then the final                precision is as (α₁, β₁).    -   b. Some examples of positions in Group 1 and Group 2:        -   i. Group 1: Position A and D, Group 2: Position J and M.        -   ii. Group 1: Position A and I, Group 2: Position J and Q.        -   iii. Group 1: Position A and D, Group 2: Position E and I,            where there are two groups are used for mode LM-L.        -   iv. Group 1: Position J and M, Group 2: Position N and Q,            where there are two groups are used for mode LM-A.        -   v. Group 1: Position A and B, Group 2: Position C and D,            where there are two groups are used for mode LM-L.        -   vi. Group 1: Position J and K, Group 2: Position L and M,            where there are two groups are used for mode LM-A.

Example 3

Suppose two chroma sample values denoted as C0 and C1, and theircorresponding luma sample values denoted as L0 and L1 (L0<L1) areinputs. The two-point method can derive α and β with the input as

$\alpha = {{\frac{{C1} - {C0}}{{L1} - {L0}}{and}\beta} = {{C0} - {\alpha L0.}}}$

The bit depths of luma samples and chroma samples are denoted BL and BC.One or more simplifications for this implementation include:

-   -   a. α is output as 0 if L1 is equal to L0. Alternatively, when L1        is equal to L0, a certain intra prediction mode (e.g., DM mode,        DC or planar) is used instead of using CCLM mode to derive the        prediction block.    -   b. The division operation is replaced by other operations with        no lookup table. log 2 operation may be implemented by checking        position of the most significant digit.        -   i. α=Shift(C1−C0, Floor(log₂(L1−L0)) or            -   α=SignShift(C1−C0, Floor(log₂(L1−L0))        -   ii. α=Shift(C1−C0, Ceiling (log₂ (L1−L0)) or            -   α=SignShift(C1−C0, Ceiling (log₂(L1−L0))        -   iii. Example i or Example ii may be selected based on the            value of L1−L0.            -   (a) For example, Example i is used if L1−L0<T, otherwise                Example ii is used. For example, T can be                (Floor(log₂(L1−L0))+Ceiling(log₂(L1−L0)))/2            -   (b) For example, Example i is used if                3×(L1−L0)<2^(Floor(Log) ² ^((L1−L0))+)2, otherwise                Example ii is used.            -   (c) For example, Example i is used if                (L1−L0)²<2^(2×Floor(Log) ² ^((L1−L0))+1), otherwise                Example ii is used.    -   c. The division operation is replaced by one lookup table        denoted as M[k].        -   i. The size of the lookup table denoted as V is less than            2^(P), where P is an integer number such as 5, 6, or 7.        -   ii. Each entry of the lookup table stores an F-bit integer            number, e.g., F=8 or 16.            -   (a) In one example, M[k−Z]=((1<<S)+Off)/k, where S is an                integer defining the precision, e.g., S=F. Off is an                offset, e.g., Off=(k+Z)>>1. Z defines the beginning                value of the table, e.g., Z=1, or Z=8, or Z=32. A valid                key k inquiring the table must satisfy k>, Z.        -   iii. k=Shift(L1−L0, W) is used as the key to inquire the            lookup table.            -   (a) In one example, W depends on BL, V and Z.            -   (b) In one example, W also depends on the value of                L1−L0.        -   iv. If k is not a valid key to inquire the lookup table            (k−Z<0 or k−Z>=V), α is output as 0.        -   v. For example,            α=Shift((C1−C0)×M[k−Z],D), or            α=SignShift((C1−C0)×M[k−Z],D)        -   vi. To get a chroma prediction CP from its corresponding            (e.g., down-sampled for 4:2:0) luma sample LR, it is            calculated as            CP=SignShift(α×LR+β,Sh), or            CP=Shift(α×LR+β,Sh)        -   vii. Sh can be a fixed number, or it may depend on the            values of C0, C1, L0, L1 used to calculated α and β.            -   (a) Sh may depend on BL, BC, V, S and D.            -   (b) D may depend on Sh.        -   viii. The size of the lookup table denoted as V is equal to            2^(P), where P is an integer number such as 5, 6, 7 or 8.            Alternatively, V is set to 2^(P)−M (e.g., M is equal to 0).        -   ix. Suppose α=P/Q (e.g. Q=L1−L0, P=C1−C0, or they are            derived in other ways), then α is calculated with the lookup            table as α=Shift(P×M[k−Z], D) or α=SignShift(P×M[k−Z], D),            where k is the key (index) to inquire an entry in the lookup            table.            -   (a) In one example, k is derived from Q with a function:                k=f(Q).            -   (b) In one example, k is derived from Q and P, with a                function: k=f(Q, P).            -   (c) In one example, k is valid in a specific range                [kMin, kMax]. For example, kMin=Z and kMax=V+Z.            -   (d) In one example, k=Shift(Q, W),                -   a. W may depend on BL, V and Z.                -   b. W may depend on the value of Q.                -   c. In one example, when k is calculated as Shift(Q,                    W), then α is calculated with the lookup table as                    α=(Shift(P×M[k−Z],D))<<W or                    α=(SignShift(P×M[k−Z],D))<<W            -   (e) In one example, k is derived in different ways with                different values of Q.                -   a. For example, k=Q when Q<=kMax, and k=Shift(Q, W)                    when Q>kMax. For example, W is chosen as the                    smallest positive integer that makes Shift(Q, W) no                    greater than kMax.                -   b. For example, k=Min(kMax, Q).                -   c. For example, k=Max(kMin, Min(kMax, Q)).            -   (f) In one example, when Q<0, −Q is used to replace Q in                the calculation. Then −α is output.            -   (g) In one example, when Q is equal to 0, then α is set                to be a default value such as 0 or 1.            -   (h) In one example, when Q is equal to 2^(E) E>=0, then                α=Shift(P, E) or α=SignShift(P, E).    -   d. All operations to derive the LM parameters must be within K        bits, K can be 8, 10, 12, 16, 24 or 32.        -   i. If an intermedia variable may exceed the range            represented by the constrained bits, it should be clipped or            right shifted to be within the constrained bits.

Example 4

One single chroma block may use multiple linear models and the selectionof multiple linear model is dependent on the position of chroma sampleswithin the chroma block.

-   -   a. In one example, LM-L and LM-A mode can be combined in a        single chroma block.    -   b. In one example, some samples are predicted by LM-L mode and        other samples are predicted by LM-A mode.        -   i. FIG. 7 shows an example. Suppose the top-left sample is            at position (0,0). Samples at position (x,y) with x>y (or            x>=y) are predicted by LM-A, and other samples are predicted            by LM-L.    -   c. Suppose the prediction with LM-L and LM-A for a sample at        position (x,y) are denoted as P1(x,y) and P2(x,y), respectively,        then the final prediction P(x,y) is calculated as a weighted sum        of P1(x,y) and P2(x,y).        -   i. P(x,y)=w1*P1(x,y)+w2*P2(x,y)            -   (a) w1+w2=1.        -   ii. P(x,y)=(w1*P1(x,y)+w2*P2(x,y)+Offset)>>shift, where            offset may be 0 or 1<<(shift-1), and shift is an integer            such as 1, 2, 3 . . . .            -   (a) w1+w2=1<<shift.        -   iii.            P(x,y)=(w1*P1(x,y)+((1<<shift)−w1)*P2(x,y)+Offset)>>shift,            where offset may be 0 or 1<<(shift-1), and shift is an            integer such as 1, 2, 3 . . . .        -   iv. w1 and w2 may depend on the position (x,y)            -   (a) For example, w1>w2 (e.g. w1=3, w2=1) if x<y,            -   (b) For example, w1<w2 (e.g. w1=1, w2=3) if x>y,            -   (c) For example, w1=w2 (e.g. w1=2, w2=2) if x==y,            -   (d) For example, w1−w2 increases if y−x increases when                x<y,            -   (e) For example, w2−w1 increases if x−y increases when                x>y.

Example 5

It is proposed that the neighboring samples (including chroma samplesand their corresponding luma samples, which may be down-sampled) aredivided into N groups. The maximum luma value and minimum luma value forthe k-th group (with k=0, 1, . . . , N−1) is denoted as MaxL_(k) andMinL_(k), and their corresponding chroma values are denoted as MaxC_(k)and MinC_(k), respectively.

-   -   a. In one example, MaxL is calculated as MaxL=f1(MaxL_(S0),        MaxL_(S1), . . . , MaxL_(Sm)); MaxC is calculated as        MaxC=f2(MaxC_(S0), MaxC_(S1), . . . MaxC_(Sm)); MinL is        calculated as MinL=f3(MinL_(S0), MinL_(S1), . . . MinL_(Sm)).        MinC is calculated as MinC=f3(MinC_(S0), MinC_(S1), . . . ,        MinC_(Sm)). f1, f2, f3 and f4 are functions. The two-point        method derives α and β with the input as:

$\alpha = \frac{{{Max}C} - {{Min}C}}{{{Max}L} - {{Min}L}}$β = MinC − αMinL

-   -   -   i. In one example, f1, f2, f3, f4 all represent the            averaging function.        -   ii. S0, S1, . . . Sm are indices of selected groups which            are used to calculate α and β.            -   (1) For example, all groups are used, e.g., S0=0, S1=1,                . . . Sm=N−1.            -   (2) For example, two groups are used, e.g., m=1, S0=0,                S1=N−1.            -   (3) For example, not all groups are used, e.g. m<N−1,                S0=0, S1=2, S3=4, . . . .

    -   b. In one example, samples (or down-sampled samples) located at        above rows may be classified to one group and samples (or        down-sampled samples) located at left columns of a block may be        classified to another group.

    -   c. In one example, samples (or down-sampled samples) are        classified based on their locations or coordinates.        -   i. For examples, samples may be classified into two groups.            -   (1) For a sample with coordinate (x,y) located at above                rows, it is classified into group S0 if x % P=Q, where P                and Q are integers, e.g. P=2, Q=1, P=2, Q=0 or P=4, Q=0;                Otherwise, it is classified into group S1.            -   (2) For a sample with coordinate (x,y) located at left                columns, it is classified into group S0 if y % P=Q,                where P and Q are integers, e.g. P=2, Q=1, P=2, Q=0 or                P=4, Q=0; Otherwise, it is classified into group S1.            -   (3) Only samples in one group, such as S0, are used to                find MaxC and MaxL. For example, MaxL=MaxLS0 and                MaxC=MaxCS0.

    -   d. In one example, only partial of neighboring samples (or        down-sampled samples) are used for divided to N groups.

    -   e. The number of groups (e.g., N) and/or the selected group        indices and/or functions (f1/f2/f3/f4) may be pre-defined or        signaled in SPS/VPS/PPS/picture header/slice header/tile group        header/LCUs/LCU/CUs.

    -   f. In one example, how to select the samples for each group may        depend the availability of neighboring blocks.        -   i. For example, MaxL₀/MaxC₀ and MinL₀/MinC₀ are found from            position A and D; MaxL₁/MaxC₁ and MinL₁/MinC₁ are found from            position J and M, then MaxL=(MaxL₀+MaxL₁)/2,            MaxC=(MaxC₀+MaxC₁)/2, MinL=(MinL₀+MinL₁)/2,            MinC=(MinC₀+MinC₁)/2, when both the left and the above            neighboring blocks are available.        -   ii. For example, MaxL/MaxC and MinL/MinC are directly found            from position A and D when only the left neighboring block            is available.            -   (1) Alternatively, α and β are set equal to some default                values if the above neighboring block is not available.                For example, α=0 and β=1<<(bitDepth−1), where bitDepth                is the bit depth of the chroma samples.        -   iii. For example, MaxL/MaxC and MinL/MinC are directly found            from position J and M when only the above neighboring block            is available.            -   (1) Alternatively, α and β are set equal to some default                values if the left neighboring block is not available.                For example, α=0 and β=1<<(bitDepth−1), where bitDepth                is the bit depth of the chroma samples.

    -   g. In one example, how to select the samples for each group may        depend the width and height of the block.

    -   h. In one example, how to select the samples for each group may        depend on the values of samples.        -   i, In one example, the two samples with the largest luma            value and minimum luma value are picked out to be in a first            group. And all other samples are in a second group.

Example 6

It is proposed that whether and how to apply LM-L and LM-A mode maydepend on the width (W) and height (H) of the current block.

-   -   (a) For example, LM-L cannot be applied if W>K×H. e.g., K=2.    -   (b) For example, LM-A cannot be applied if H>K×W. e.g., K=2.    -   (c) If one of LM-L and LM-A cannot be applied, the flag to        indicate whether LM-L or LM-A is used should not be signaled.

Example 7

A flag is signaled to indicate whether CCLM mode is applied. The contextused in arithmetic coding to code the flag may depend on whether thetop-left neighboring block as shown in FIG. 8 applies CCLM mode or not.

(a) In one example, a first context is used if the top-left neighboringblock applies CCLM mode; and a second context is used if the top-leftneighboring block does not apply CCLM mode.

(b) In one example, if the top-left neighboring block is not available,it is considered as not applying CCLM mode.

(c) In one example, if the top-left neighboring block is not available,it is considered as applying CCLM mode.

(d) In one example, if the top-left neighboring block is notintra-coded, it is considered as not applying CCLM mode.

(e) In one example, if the top-left neighboring block is notintra-coded, it is considered as applying CCLM mode.

Example 8

Indications or codewords of DM and LM modes may be coded in differentorders from sequence to sequence/picture to picture/tile to tile/blockto block.

-   -   (a) The coding order of indications of LM and DM (e.g., firstly        code whether it is LM mode, if not, then code whether it is DM        mode; or firstly code whether it is DM mode, if not, then code        whether it is LM mode) may be depend on the mode information of        one or multiple neighboring blocks.    -   (b) In one example, when the top-left block of the current block        is available and coded with LM mode, then the indication of LM        mode is firstly coded.    -   (c) Alternatively, when the top-left block of the current block        is available and coded with DM mode, then the indication of DM        mode is firstly coded.    -   (d) Alternatively, when the top-left block of the current block        is available and coded with non-LM (e.g., DM mode or other intra        prediction modes excluding LM), then the indication of DM mode        is firstly coded.    -   (e) In one example, indications of the order may be signaled in        in SPS/VPS/PPS/picture header/slice header/tile group        header/LCUs/LCU/CUs.

Example 9

In above examples, samples (or down-sampled samples) may be locatedbeyond the range of 2×W above neighboring samples or 2×H leftneighboring samples as shown in FIG. 6 .

-   -   (a) With LM mode or LM-L mode, it may use a neighboring sample        RecC[x−1, y+d], where d is in the range of [T, S]. T may be        smaller than 0, and S may be larger than 2H−1. For example, T=−4        and S=3H. In another example, T=0, S=max(2H, W+H). In still        another example, T=0 and S=4H.    -   (b) With LM mode or LM-A mode, it may use a neighboring sample        RecC[x+d, y], where d is in the range of [T, S]. T may be        smaller than 0, and S may be larger than 2 W−1. For example,        T=−4 and S=3 W. In another example, T=0, S=max(2 W, W+H). In        still another example, T=0 and S=4 W.

Example 10

In one example, the chroma neighboring samples and their correspondingluma samples (may be down-sampled) are down-sampled before deriving thelinear model parameters α and β as disclosed in Examples 1-7. Supposethe width and height of the current chroma block is W and H.

-   -   (a) In one example, whether and how to conduct down-sampling may        depend on W and H.    -   (b) In one example, the number of neighboring samples used to        derive the parameters left to the current block, and the number        of neighboring samples used to derive the parameters above to        the current block should be the same after the down-sampling        process.    -   (c) In one example, the chroma neighboring samples and their        corresponding luma samples (may be down-sampled) are not        down-sampled if W is equal to H.    -   (d) In one example, the chroma neighboring samples and their        corresponding luma samples (may be down-sampled) left to the        current block are down-sampled if W<H.        -   (i) In one example, one chroma sample in each H/W chroma            samples are picked to be used for deriving a and R. Other            chroma samples are discarded. For example, suppose R[0, 0]            represents the top-left sample of the current block, then            R[−1, K*H/W], K from 0 to W−1, are picked to be used for            deriving α and β.    -   (e) In one example, the chroma neighboring samples and their        corresponding luma samples (may be down-sampled) above to the        current block are down-sampled if W>H.        -   (ii) In one example, one chroma sample in each W/H chroma            samples are picked to be used for deriving a and R. Other            chroma samples are discarded. For example, suppose R[0, 0]            represents the top-left sample of the current block, then            R[K*W/H, −1], K from 0 to H−1, are picked to be used for            deriving α and β.        -   (ii) FIG. 9 shows examples of samples to be picked up when            position D and position M in FIG. 6 are used to derive α and            β, and down-sampling performed when W>H.

Example 11

Neighboring downsampled/originally reconstructed samples and/ordownsampled/originally reconstructed samples may be further refinedbefore being used in the linear model prediction process or cross-colorcomponent prediction process.

-   -   (a) “To be refined” may refer to a filtering processing.    -   (b) “To be refined” may refer to any non-linear processing    -   (c) It is proposed that several neighbouring samples (including        chroma samples and their corresponding luma samples, which may        be down-sampled) are picked up to calculate C1, C0, L1 and L0,        in order to derive α and β, such as α=(C1−C0)/(L1−L0) and        β=C0−αL0.    -   (d) In one example, S neighboring luma samples (maybe        down-sampled) denoted as Lx1, Lx2, . . . , LxS, and their        corresponding chroma samples denoted as Cx1, Cx2, . . . CxS are        used to derive C0 and L0, and T neighboring luma samples (maybe        down-sampled) denoted as Ly1, Ly2, . . . , LyT, and their        corresponding chroma samples denoted as Cy1, Cy2, . . . CyT are        used to derive C1 and L1 as:        -   (i) C0=f0(Cx1, Cx2, . . . CxS), L0=f1(Lx1, Lx2, . . . LxS),            C1=f2(Cy1, Cy2, . . . CyT), L1=f4(Ly1, Ly2, . . . LyT). f0,            f1, f2 and f3 are any functions.        -   (ii) In one example, f0 is identical to f1.        -   (iii) In one example, f2 is identical to f3.        -   (iv) In one example, f0 f1 f2 f3 are identical.            -   1. For example, they are all the averaging function.        -   (v) In one example, S is equal to T.            -   1. In one example, the set {x1,x2, . . . xS} is                identical to the set {y1, y2, . . . , yT}.        -   (vi) In one example, Lx1, Lx2, . . . , LxS are chosen as the            smallest S luma samples of a group of luma samples.            -   1. For example, the group of luma samples includes all                neighboring samples used in VTM-3.0 to derive CCLM                linear parameters.            -   2. For example, the group of luma samples includes                partial neighboring samples used in VTM-3.0 to derive                CCLM linear parameters.                -   a. For example, the group of luma samples includes                    four samples as shown in FIG. 2-5 .        -   (vii) In one example, Ly1, Ly2, . . . , LyS are chosen as            the largest S luma samples of a group of luma samples.            -   1. For example, the group of luma samples includes all                neighboring samples used in VTM-3.0 to derive CCLM                linear parameters.            -   2. For example, the group of luma samples includes                partial neighboring samples used in VTM-3.0 to derive                CCLM linear parameters.                -   a. For example, the group of luma samples includes                    four samples as shown in FIGS. 2-5 .

Example 12

It is proposed to select other neighboring or downsampled neighboringsamples based on the largest neighboring or downsampled neighboringsample in a given set of neighboring or downsampled neighboring samples.

-   -   (a) In one example, denote the largest neighboring or        downsampled neighboring sample is located at position (x0, y0).        Then samples in the region (x0−d1, y0), (x0, y0−d2), (x0+d3,        y0), (x0, y0+d4) may be utilized to select other samples.        Integers {d1, d2, d3, d4} may depend on the position (x0, y0).        For example, if (x0, y0) is left to the current block, then        d1=d3=1 and d2=d4=0. If (x0,y0) is above to the current block,        then d1=d3=0 and d2=d4=1.    -   (b) In one example, denote the smallest neighboring or        downsampled neighboring sample is located at position (x1, y1).        Then samples in the region (x1−d1, y1), (x1, y1−d2), (x1+d3,        y1), (x1, y1+d4) may be utilized to select other samples.        Integers {d1, d2, d3, d4} may depend on the position (x1, y1).        For example, if (x1, y1) is left to the current block, then        d1=d3=1 and d2=d4=0. If (x1,y1) is above to the current block,        then d1=d3=0 and d2=d4=1.    -   (c) In one example, the above samples are representing samples        of one color component (e.g., luma color component). Samples        used in CCLM/cross-color component process may be derived by        corresponding coordinates of a second color component.    -   (d) Similar way can be used to derive smallest samples.

Example 13

in above examples, luma and chroma may be switched. alternatively, lumacolor component may be replaced by the main color component (e.g., G),and chroma color component may be replaced by dependent color component(e.g., B or R).

Example 14

Selection of locations of chroma samples (and/or corresponding lumasamples) may depend on the coded mode information.

-   -   (a) Alternatively, furthermore, it may depend on the        availability of neighboring samples, such as whether left column        or above row or above-right row or below-left column is        available. FIG. 10 depicts the concepts of left column/above        row/above-right row/below-left column relative to a block.    -   (b) Alternatively, furthermore, it may depend on the        availability of samples located at certain positions, such as        whether the 1^(st) top-right sample and/or 1^(st) below-left        sample is available.    -   (c) Alternatively, furthermore, it may depend on block        dimensions.        -   (i) Alternatively, furthermore, it may depend on the ratio            between width and height of current chroma (and/or luma)            block.        -   (ii) Alternatively, furthermore, it may depend on whether            the width and/or height is equal to K (e.g., K=2).    -   (d) In one example, when the current mode is a normal LM mode,        the following ways may be applied to select chroma samples        (and/or luma samples downsampled or non-downsampled):        -   (i) If both left column and above row are available, two            samples of left column and two of above row may be selected.            They may be located at (suppose the top-left coordinate of            the current block is (x, y)):            -   1. (x−1, y), (x, y−1), (x−1, y+H−1) and (x+W−1, y−1)            -   2. (x−1, y), (x, y−1), (x−1, y+H−H/W−1) and (x+W−1,                y−1). For example, when H is larger than W.            -   3. (x−1, y), (x, y−1), (x−1, y+H−1) and (x+W−W/H−1,                y−1). For example, when H is smaller than W.            -   4. (x−1, y), (x, y−1), (x−1, y+H max(1, H/W)) and                (x+W−max(1, W/H), y−1).        -   (ii) If only above row is available, samples are only            selected from the above row.            -   1. For example, four samples of above row may be                selected.            -   2. For example, two samples may be selected.            -   3. How to select the samples may depend on the                width/height. For example, four samples are selected                when W>2 and two samples are selected when W=2.            -   4. The selected samples may be located at (suppose the                top-left coordinate of the current block is (x, y)):    -   a. (x, y−1), (x+W/4, y−1), (x+2*W/4, y−1), (x+3*W/4, y−1)    -   b. (x, y−1), (x+W/4, y−1), (x+3*W/4, y−1), (x+W−1, y−1)    -   c. (x, y−1), (x+(2W)/4, y−1), (x+2*(2W)/4, y−1), (x+3*(2W)/4,        y−1).

For example, when top-right row is available, or when 1st top-rightsample is available.

-   -   d. (x, y−1), (x+(2W)/4, y−1), (x+3*(2W)/4, y−1), (x+(2W)−1,        y−1).

For example, when top-right row is available, or when 1st top-rightsample is available.

-   -   (iii) If only left column is available, samples are only        selected from the left column.        -   1. For example, four samples of left column may be selected;        -   2. For example, two samples of left column may be selected;        -   3. How to select the samples may depend on the width/height.            For example, four samples are selected when H>2 and two            samples are selected when H=2.        -   4. The selected samples may be located at:    -   a. (x−1, y), (x−1, y+H/4), (x−1, y+2*H/4), (x−1, y+3*H/4)    -   b. (x−1, y), (x−1, y+2*H/4), (x−1, y+3*H/4), (x−1, y+H−1)    -   c. (x−1, y), (x−1, y+(2H)/4), (x−1, y+2*(2H)/4), (x−1,        y+3*(2H)/4).

For example, when below-left column is available, or when 1st below-leftsample is available.

-   -   d. (x−1, y), (x−1, y+2*(2H)/4), (x−1, y+3*(2H)/4), (x−1,        y+(2H)−1).

For example, when below-left column is available, or when 1st below-leftsample is available.

-   -   (iv) For above examples, only two of the four samples may be        selected.    -   (e) In one example, when the current mode is the LM-A mode, it        may choose samples according to Example 11(d)(ii).    -   (f) In one example, when the current mode is the LM-L mode, it        may choose samples according to Example 11(d)(iii).    -   (g) The luma selected samples (e.g., according to the selected        chroma locations) may be grouped to 2 groups, one is with the        largest value and smallest value of all selected samples, the        other group is with all remaining samples.    -   (i) The two maximum values of 2 groups are averaged as the        maximum value in the 2-point method; the two minimum values of 2        groups are averaged as the minimum value in the 2-point method        to derive LM parameters.    -   (ii) When there are only 4 samples selected, two larger sample        values are averaged, two smaller sample values are averaged, and        averaged values are used as the input to the 2-point method to        derive LM parameters.

Example 15

In above examples, luma and chroma may be switched. Alternatively, lumacolor component may be replaced by the main color component (e.g., G),and chroma color component may be replaced by dependent color component(e.g., B or R).

Example 16

It is proposed to select the above neighbouring chroma samples (and/ortheir corresponding luma samples which may be down-sampled) based on afirst position offset value (denoted as F) and a step value (denoted asS). Suppose the width of available above neighbouring samples to be usedis W.

-   -   a. In one example, W may be set to the width of current block.    -   b. In one example, W may be set to (L* width of current block)        wherein L is an integer value.    -   c. In one example, when both above and left blocks are        available, W may be set to the width of current block.        -   i. Alternatively, when the left block is NOT available, W            may be set to (L* width of current block) wherein L is an            integer value.        -   ii. In one example, L may be dependent on the availability            of top-right block. Alternatively, L may depend on the            availability of one top-left sample.    -   d. In one example, W may depend on the coded mode.        -   i. In one example, W may be set to the width of current            block if the current block is coded as LM mode;        -   ii. W may be set to (L* width of current block) wherein L is            an integer value if the current block is coded as LM-A mode.            -   (a) L may be dependent on the availability of top-right                block.

Alternatively, L may depend on the availability of one top-left sample.

-   -   e. Suppose the top-left coordinate of the current block is (x0,        y0), then the above neighbouring samples at positions (x0+F+K×S,        y0−1) with K=0, 1, 2, . . . kMax are selected.    -   f. In one example, F=W/P. P is an integer.        -   i. For example, P=2^(i), where i is an integer such as 1 or            2.        -   ii. Alternatively, F=W/P+offset.    -   g. In one example, S=W/Q. Q is an integer.        -   i. For example, Q=2^(j), where j is an integer such as 1 or            2.    -   h. In one example, F=S/R. R is an integer.        -   i. For example, R=2^(m), where m is an integer such as 1 or            2.    -   i. In one example, S=F/Z. Z is an integer.        -   i. For example, Z=2^(n), where n is an integer such as 1 or            2.    -   j. kMax and/or F and/or S and/or offset may depend on the        prediction mode (such as LM, LM-A or LM-L) of the current block;    -   k. kMax and/or F and/or S and/or offset may depend on the width        and/or height of the current block.    -   l. kMax and/or F and/or S and/or offset may depend on        availability of neighbouring samples.    -   m. kMax and/or F and/or S and/or offset may depend on W.    -   n. For example, kMax=1, F=W/4, S=W/2, offset=0. Alternatively,        furthermore, the settings are done if the current block is LM        coded, both the left and above neighbouring samples are        available, and W>=4.    -   o. For example, kMax=3, F=W/8, 5=W/4, offset=0. Alternatively,        furthermore, the settings are done if the current block is LM        coded, only above neighbouring samples are available, and W>=4.    -   p. For example, kMax=3, F=W/8, 5=W/4, offset=0. Alternatively,        furthermore, the settings are done if the current block is LM-A        coded and W>=4.    -   q. For example, kMax=1, F=0, S=1, offset=0. Alternatively,        furthermore, the settings are done if W is equal to 2.

Example 17

It is proposed to select the left neighbouring chroma samples (and/ortheir corresponding luma samples which may be down-sampled) based on afirst position offset value (denoted as F) and a step value (denoted asS). Suppose the height of available left neighbouring samples to be usedis H.

-   -   a. In one example, H may be set to the height of current block.    -   b. In one example, H may be set to (L* height of current block)        wherein L is an integer value.    -   c. In one example, when both above and left blocks are        available, H may be set to the height of current block.        -   i. Alternatively, when the above block is NOT available, H            may be set to (L* height of current block) wherein L is an            integer value.        -   ii. In one example, L may be dependent on the availability            of below-left block. Alternatively, L may be dependent on            the availability of one below-left sample.        -   iii. Alternatively, H may be set to (height of current            block+width of the current block) if the required            above-right neighbouring blocks are available.            -   (a) In one example, same H above neighbouring samples                are picked for LM-A mode and LM mode when left                neighbouring samples are unavailable.    -   d. In one example, H may depend on the coded mode.        -   i. In one example, H may be set to the height of current            block if the current block is coded as LM mode;        -   ii. W may be set to (L* height of current block) wherein L            is an integer value if the current block is coded as LM-L            mode.            -   (a) L may be dependent on the availability of below-left                block. Alternatively, L may depend on the availability                of one top-left sample.            -   (b) Alternatively, W may be set to (height of current                block+width of the current block) if the required                below-left neighbouring blocks are available.            -   (c) In one example, same W left neighbouring samples are                picked for LM-L mode and LM mode when above neighbouring                samples are unavailable.    -   e. Suppose the top-left coordinate of the current block is (x0,        y0), then the left neighbouring samples at positions (x0−1,        y0+F+K×S) with K=0, 1, 2, . . . kMax are selected.    -   f. In one example, F=H/P. P is an integer.        -   i. For example, P=2^(i), where i is an integer such as 1 or            2.        -   ii. Alternatively, F=H/P+offset.    -   g. In one example, S=H/Q. Q is an integer.        -   i. For example, Q=Z, where j is an integer such as 1 or 2.    -   h. In one example, F=S/R. R is an integer.        -   i. For example, R=2m, where m is an integer such as 1 or 2.    -   i. In one example, S=F/Z. Z is an integer.        -   i. For example, Z=2n, where n is an integer such as 1 or 2.    -   j. kMax and/or F and/or S and/or offset may depend on the        prediction mode (such as LM, LM-A or LM-L) of the current block;    -   k. kMax and/or F and/or S and/or offset may depend on the width        and/or height of the current block.    -   l. kMax and/or F and/or S and/or offset may depend on H.    -   m. kMax and/or F and/or S and/or offset may depend on        availability of neighbouring samples.    -   n. For example, kMax=1, F=H/4, S=H/2, offset=0. Alternatively,        furthermore, the settings are done if the current block is LM        coded, both the left and above neighbouring samples are        available, and H>=4.    -   o. For example, kMax=3, F=H/8, 5=H/4, offset=0. Alternatively,        furthermore, the settings are done if the current block is LM        coded, only above neighbouring samples are available, and H>=4.    -   p. For example, kMax=3, F=H/8, S=H/4, offset=0. Alternatively,        furthermore, the settings are done if the current block is LM-L        coded and H>=4.    -   q. For example, kMax=1, F=0, S=1, offset=0 if H is equal to 2.

Example 18

It is proposed two or four neighbouring chroma samples (and/or theircorresponding luma samples which may be down-sampled) are selected toderive the linear model parameters.

-   -   a. In one example, maxY/maxC and minY/minC are derived from two        or four neighbouring chroma samples (and/or their corresponding        luma samples which may be down-sampled), and are then used to        derive the linear model parameters with the 2-point approach.    -   b. In one example, if there are two neighbouring chroma samples        (and/or their corresponding luma samples which may be        down-sampled) are selected to derive the maxY/maxC and        minY/minC, minY is set to be the smaller luma sample value and        minC is its corresponding chroma sample value; maxY is set to be        the larger luma sample value and maxC is its corresponding        chroma sample value.    -   c. In one example, if there are four neighbouring chroma samples        (and/or their corresponding luma samples which may be        down-sampled) are selected to derive the maxY/maxC and        minY/minC, the luma samples and their corresponding chroma        samples are divided into two arrays G0 and G1, each contains two        luma samples and their corresponding luma samples.        -   i. Suppose the four luma samples and their corresponding            chroma samples are denoted as S0, S1, S2, S3, then they can            be divided into two groups in any order. For example:            -   (a) G0={S0, S1}, G1={S2, S3};            -   (b) G0={S1, S0}, G1={S3, S2};            -   (c) G0={S0, S2}, G1={S1, S3};            -   (d) G0={S2, S0}, G1={S3, S1};            -   (e) G0={S1, S2}, G1={S0, S3};            -   (f) G0={S2, S1}, G1={S3, S0};            -   (g) G0={S0, S3}, G1={S1, S2};            -   (h) G0={S3, S0}, G1={S2, S1};            -   (i) G0={S1, S3}, G1={S0, S2};            -   (j) G0={S3, S1}, G1={S2, S0};            -   (k) G0={S3, S2}, G1={S0, S1};            -   (l) G0={S2, S3}, G1={S1, S0};            -   (m) G0 and G1 may be swapped.        -   ii. In one example, Luma sample value of G0[0] and G0[1] are            compared, if luma sample value of G0[0] is larger than luma            sample value of G0[1], the luma sample and its corresponding            chroma sample onf G0[0] are swapped with those on G0[1].            -   (a) Alternatively, if luma sample value of G0[0] is                larger than or equal to luma sample value of G0[1], the                luma sample and its corresponding chroma sample of G0[0]                are swapped with those onf G0[1].            -   (b) Alternatively, if luma sample value of G0[0] is                smaller than luma sample value of G0[1], the luma sample                and its corresponding chroma sample of G0[0] are swapped                with those onf G0[1].            -   (c) Alternatively, if luma sample value of G0[0] is                smaller than or equal to luma sample value of G0[1], the                luma sample and its corresponding chroma sample of G0[0]                are swapped with those onf G0[1].        -   iii. In one example, Luma sample value of G1[0] and G1[1]            are compared, if luma sample value of G1[0] is larger than            luma sample value of G1[1], the luma sample and its            corresponding chroma sample of G1[0] are swapped with those            onf G1[1].            -   (a) Alternatively, if luma sample value of G1[0] is                larger than or equal to luma sample value of G1[1], the                luma sample and its corresponding chroma sample of G1[0]                are swapped with those onf G1[1].            -   (b) Alternatively, if luma sample value of G1[0] is                smaller than luma sample value of G1[1], the luma sample                and its corresponding chroma sample of G1[0] are swapped                with those onf G1[1].            -   (c) Alternatively, if luma sample value of G1[0] is                smaller than or equal to luma sample value of G1[1], the                luma sample and its corresponding chroma sample of G1[0]                are swapped with those onf G1[1].        -   iv. In one example, Luma sample value of G0[0] and G1[1] are            compared, if luma sample value of G0[0] is larger than (or            smaller than, or not larger than, or not smaller than) luma            sample value of G1[1], then G0 and G1 are swapped.            -   (a) In one example, Luma sample value of G0[0] and G1[0]                are compared, if luma sample value of G0[0] is larger                than (or smaller than, or not larger than, or not                smaller than) luma sample value of G1[0], then G0 and G1                are swapped.            -   (b) In one example, Luma sample value of G0[1] and G1[0]                are compared, if luma sample value of G0[1] is larger                than (or smaller than, or not larger than, or not                smaller than) luma sample value of G1[0], then G0 and G1                are swapped.            -   (c) In one example, Luma sample value of G0[1] and G1[1]                are compared, if luma sample value of G0[1] is larger                than (or smaller than, or not larger than, or not                smaller than) luma sample value of G1[1], then G0 and G1                are swapped.        -   v. In one example, Luma sample value of G0[0] and G1[1] are            compared, if luma sample value of G0[0] is larger than (or            smaller than, or not larger than, or not smaller than) luma            sample value of G1[1], then G0[0] and G1[1] are swapped.            -   (a) In one example, Luma sample value of G0[0] and G1[0]                are compared, if luma sample value of G0[0] is larger                than (or smaller than, or not larger than, or not                smaller than) luma sample value of G1[0], then G0[0] and                G1[0] are swapped.            -   (b) In one example, Luma sample value of G0[1] and G1[0]                are compared, if luma sample value of G0[1] is larger                than (or smaller than, or not larger than, or not                smaller than) luma sample value of G1[0], then G0[1] and                G1[0] are swapped.            -   (c) In one example, Luma sample value of G0[1] and G1[1]                are compared, if luma sample value of G0[1] is larger                than (or smaller than, or not larger than, or not                smaller than) luma sample value of G1[1], then G0[1] and                G1[1] are swapped.        -   vi. In one example, maxY is calculated as the average of            luma sample values of G0[0] and G0[1], maxC is calculated as            the average of chroma sample values of G0[0] and G0[1].            -   (a) Alternatively, maxY is calculated as the average of                luma sample values of G1[0] and G1[1], maxC is                calculated as the average of chroma sample values of                G1[0] and G1[1].        -   vii. In one example, minY is calculated as the average of            luma sample values of G0[0] and G0[1], minC is calculated as            the average of chroma sample values of G0[0] and G0[1].            -   Alternatively, minY is calculated as the average of luma                sample values of G1[0] and G1[1], minC is calculated as                the average of chroma sample values of G1[0] and G1[1].    -   d. In one example, if there are only two neighbouring chroma        samples (and/or their corresponding luma samples which may be        down-sampled) are available, they are first padded to be four        chroma samples (and/or their corresponding luma samples), then        the four chroma samples (and/or their corresponding luma        samples) are used to derive the CCLM parameters.        -   i. In one example, two padding chroma samples (and/or their            corresponding luma samples) are copied from the two            available neighbouring chroma samples (and/or their            corresponding luma samples which may be down-sampled)

Example 19

In all above examples, the selected chroma samples shall be locatedwithin the above row (i.e., with W samples) as depicted in FIG. 10 ,and/or the left column (i.e., with H samples) wherein W and H are thewidth and height of the current block.

-   -   a. Alternatively, above restriction may be applied when current        block is coded with the normal LM mode.    -   b. Alternatively, the selected chroma samples shall be located        within the above row (i.e., with W samples) and above-right row        with H samples.        -   i. Alternatively, furthermore, the above restriction may be            applied when the current block is coded with the LM-A mode.        -   ii. Alternatively, furthermore, the above restriction may be            applied when the current block is coded with the LM-A mode            or the normal LM mode with above row available but left            column is unavailable.    -   c. Alternatively, the selected chroma samples shall be located        within the left column (i.e., with H samples) and below-left        column with W samples.        -   i. Alternatively, furthermore, the above restriction may be            applied when the current block is coded with the LM-L mode.        -   ii. Alternatively, furthermore, the above restriction may be            applied when the current block is coded with the LM-L mode            or the normal LM mode with above row unavailable but left            column is available.

Example 20

In one example, only the neighbouring luma samples at the positionswhere corresponding chroma samples are required to derive the CCLMparameters, need to be down-sampled.

Example 21

How to conduct the methods disclosed in this document may depend on thecolor format (such as 4:2:0 or 4:4:4).

-   -   a. Alternatively, how to conduct the methods disclosed in this        document may depend on the bit-depth (such as 8-bit or 10-bit).    -   b. Alternatively, how to conduct the methods disclosed in this        document may depend on the color representation method (such as        RGB or YCbCr).    -   c. Alternatively, how to conduct the methods disclosed in this        document may depend on the color representation method (such as        RGB or YCbCr).    -   d. Alternatively, how to conduct the methods disclosed in this        document may depend on the chroma down-sampling location.

Example 22

Whether to derive the maximum/minimum values of luma and chromacomponents used to derive CCLM parameters may depend on the availabilityof left and above neighbours. For example, the maximum/minimum valuesfor luma and chroma components used to derive CCLM parameters may not bederived if both the left and above neighbouring blocks are unavailable.

-   -   a. Whether to derive the maximum/minimum values of luma and        chroma components used to derive CCLM parameters may depend on        the number of available neighbor samples. For example, the        maximum/minimum values for luma and chroma components used to        derive CCLM parameters may not be derived if numSampL==0 and        numSampT==0. In another example, the maximum/minimum values for        luma and chroma components used to derive CCLM parameters may        not be derived if numSampL+numSampT==0. In the two examples,        numSampL and numSampT are the number of available neighbouring        samples from left and above neighbouring blocks.    -   b. Whether to derive the maximum/minimum values of luma and        chroma components used to derive CCLM parameters may depend on        the number of picked samples used to derive the parameters. For        example, the maximum/minimum values for luma and chroma        components used to derive CCLM parameters may not be derived if        cntL==0 and cntT==0. In another example, the maximum/minimum        values for luma and chroma components used to derive CCLM        parameters may not be derived if cntL+cntT==0. In the two        examples, cntL and cntT are the number of picked samples from        left and above neighbouring blocks.

Example 23

In one example, the proposed method to derive the parameters used inCCLM, may be used to derive the parameters used in LIC or other codingtools that relies on linear model.

-   -   a. The bullets disclosed above may be applied to LIC, such as by        replacing “chroma neighbouring samples” by “neighbouring samples        of the current block” and replacing “corresponding luma samples”        by “neighbouring samples of the reference block”.    -   b. In one example, the samples utilized for LIC parameter        derivation may exclude samples certain positions in the above        row and/or left column.        -   i. In one example, the samples utilized for LIC parameter            derivation may exclude the first one in the above row.            -   (a) Suppose that the top-left sample's coordinate is                (x0, y0), it is proposed to exclude (x0, y0−1) for the                usage of LIC parameters.        -   ii. In one example, the samples utilized for LIC parameter            derivation may exclude the first one in the left column.            -   (a) Suppose that the top-left sample's coordinate is                (x0, y0), it is proposed to exclude (x0−1, y0) for the                usage of LIC parameters.        -   iii. Whether to apply above methods and/or how to define the            certain positions may depend on the availability of left            column/above row.        -   iv. Whether to apply above methods and/or how to define the            certain positions may depend on block dimension.    -   c. In one example, N neighbouring samples (which may be        down-sampled) of the current block and N corresponding        neighbouring samples (which may be down-sampled correspondingly)        of the reference block may be used to derive the parameters used        for LIC.        -   i. For example, N is 4.        -   ii. In one example, the N neighboring samples may be defined            as N/2 samples from above row; and N/2 samples from left            column.            -   (a) Alternatively, the N neighboring samples may be                defined as N samples from above row or left column.        -   iii. In another example, N is equal to min (L, T), where T            is the total number of available neighbouring samples (which            may be down-sampled) of the current block.            -   (a) In one example, L is set to 4        -   iv. In one example, the selection of the coordinates of the            N samples may follow the rule for selecting N samples in the            CCLM process.        -   v. In one example, the selection of the coordinates of the N            samples may follow the rule for selecting N samples in the            LM-A process.        -   vi. In one example, the selection of the coordinates of the            N samples may follow the rule for selecting N samples in the            LM-L process.        -   vii. In one example, how to select the N samples may depend            on the availability of above row/left column.    -   d. In one example, the N neighbouring samples (which may be        down-sampled) of the current block and the N corresponding        neighbouring samples (which may be down-sampled correspondingly)        of the reference block are used to derive the parameters used in        LIC, may be picked up based on sample positions.        -   i. The picking up method may depend on width and height of            the current block.        -   ii. The picking up method may depend on the availability of            the neighbouring blocks.        -   iii. For example, K1 neighbouring samples may be picked up            from the left neighbouring samples and K2 neighbouring            samples are picked up from the above neighbouring samples,            if both above and left neighbouring samples are available.            E.g. K1=K2=2.        -   iv. For example, K1 neighbouring samples may be picked up            from the left neighbouring samples if only left neighbouring            samples are available. E.g. K1=4.        -   v. For example, K2 neighbouring samples may be picked up            from the above neighbouring samples if only above            neighbouring samples are available. E.g. K2=4.        -   vi. For example, the above samples may be picked up with a            first position offset value (denoted as F) and a step value            (denoted as S) which may depend on the dimension of the            current block and the availability of the neighbouring            blocks.            -   (a) For example, methods disclosed in bullet 13 can be                applied to derive F and S.        -   vii. For example, the left samples may be picked up with a            first position offset value (denoted as F) and a step value            (denoted as S) which may depend on the dimension of the            current block and the availability of the neighboring            blocks.        -   (a) For example, methods disclosed in bullet 14 can be            applied to derive F and S.    -   e. In one example, the proposed method to derive the parameters        used in CCLM, may also be used to derive the parameters used in        LIC, when the current block is affine-coded.    -   f. The above methods may be used to derive the parameters used        in other coding tools that relies on linear model.

In another example, cross-component prediction mode is proposed whereinthe chroma samples are predicted with corresponding reconstructed lumasamples according to the prediction model, as shown in Eq. 12. In Eq.12, Pred_(C)(x, y) denotes a prediction sample of chroma. α and β aretwo model parameters. Rec′L(x, y) is a down-sampled luma sample.Pred_(C)(x,y)=α×Rec_(L)′(x,y)+β,  (12)

A six-tap filter is introduced for the luma down-sampled process forblock A in FIG. 11 , as shown in Eq. 13.Rec_(L)′(x,y)=(2×Rec_(L)(2x,2y)+2×Rec_(L)(2x,2y+1))+Rec_(L)(2x−1,2y)+Rec_(L)(2x+1,2y)+Rec_(L)(2x−1,2y+1)+Rec_(L)(2x+1,2y+1)+4)>>3  (13)

The above surrounding luma reference samples shaded in FIG. 11 aredown-sampled with a 3-tap filter, as shown in Eq. 14. The leftsurrounding luma reference samples are down-sampled according to Eq. 15.If the left or above samples are not available, a 2-tap filter definedin Eq. 16 and Eq. 17 will be used.Rec_(L)′(x,y)=(2×Rec_(L)(2x,2y)+Rec_(L)(2x−1,2y)+Rec_(L)(2x+1,2y))»2  (14)Rec_(L)′(x,y)==(2×Rec_(L)(2x,2y)+Rec_(L)(2x,2y+1)+Rec_(L)(2x,2y+1))»2  (15)Rec_(L)′(x,y)=(3×Rec_(L)(2x,2y)+Rec_(L)(2x+1,2y)+2)>>2  (16)Rec_(L)′(x,y)=(3×Rec_(L)(2x,2y)+Rec_(L)(2x,2y+1)+2)>>2  (17)

In particular, the surrounding luma reference samples are down sampledto the equal size to the chroma reference samples. The size is denotedas width and height. To derive α and β, only two or four neighboringsamples are involved. A look-up table is applied to avoid the divisionoperation when deriving a and ft. The derivation methods is illustratedbelow.

3.1 Exemplary Methods with Up to Two Samples

(1) The ratio r of width and height is calculated as shown in Eq. 18.

$\begin{matrix}{r = \left\{ \begin{matrix}\frac{width}{height} & {{{if}{width}} \geq {height}} \\\frac{height}{width} & {{{if}{height}} < {width}}\end{matrix} \right.} & (18)\end{matrix}$

(2) If the above and the left blocks are both available, 2 sampleslocating at posA of the first above line, and posL of the first leftline are selected. To simplify the description, width is assumed as thelonger side. The derivation of posA and posL is shown in Eq. 19 (Theposition index starts from 0). FIG. 12 shows some examples of differentwidth and height ratio (1, 2, 4 and 8, respectively). The selectedsamples are shaded.posA=width−rposL=height  (19)

(3) If the above block is available while the left block is notavailable, the first and the posA points of the above line are selected,as shown in FIG. 13 .

(4) If the left block is available while the above block is notavailable, the first and the posL points of the left line are selected,as shown in FIG. 14 .

(5) A chroma prediction model is derived according to the luminance andchrominance values of selected samples.

(6) If neither of the left and above blocks are available, a defaultprediction model is used, with α equals 0, β equals to 1<<(BitDepth−1),where BitDepth represents the bit-depth of chroma samples.

3.2 Exemplary Methods with Up to Four Samples

(1) The ratio r of width and height is calculated as Eq. 18.

(2) If the above and the left blocks are both available, 4 sampleslocating at the first and posA of the first above line, the first andposL of the first left line are selected. The derivation of posA andposL is illustrated in Eq. 19. FIG. 15 shows some examples of differentwidth and height ratio (1, 2, 4 and 8, respectively). The selectedsamples are shaded.

(3) If the above block is available while the left block is notavailable, the first and the posA points of the above line are selected,as shown in FIG. 13 .

(4) If the left block is available while the above block is notavailable, the first and the posL points of the left line are selected,as shown in FIG. 14 .

(5) If neither of the left and above blocks are available, a defaultprediction model is used, with a equals 0, β equals to 1<<(BitDepth−1),where BitDepth represents the bit-depth of chroma samples.

3.3 Exemplary Methods that Use Lookup Tables in LM Derivation

FIG. 16 shows an example of lookup tables with 128, 64 and 32 entriesand each entry is represented by 16 bits. The 2-point LM derivationprocess is simplified as shown in Table 1 and FIG. 17 with 64 entries.It should be noted that the first entry may not be stored into thetable.

It should also be noted that although each entry in the exemplary tablesare designed to be with 16 bits, it can be easily transformed to anumber with less bits (such as 8 bits or 12 bits). For example, a tableof entries with 8 bits can be attained as:g_aiLMDivTableHighSimp_64_8[i]=(g_aiLMDivTableHighSimp_64[i]+128)>>8.

For example, a table of entries with 12 bits can be attained as:g_aiLMDivTableHighSimp_64_12[i]=(g_aiLMDivTableHighSimp_64[i]+8)>>4.

TABLE 1 Simplified LM derivation process int iDeltaLuma = maxLuma −minLuma; const int TABLE_PRECISION = 16; // It may be 8 or 12. const intBIT_DEPTH = 10; // Bit depth for samples. int shift = TABLE_PRECISION;if( iDeltaLuma > 64) {    int depthshift = BIT_DEPTH − 6; // 64 is equalto 2{circumflex over ( )}6.   iDeltaLuma = (iDeltaLuma +(1<<(depthshift-1)))>> depthshift;   shift −= depthshift; } a =(((maxChroma − minChroma)*g_aiLMDivTableHighSimp_64 [iDeltaLuma-1] +(1<<(shift − l))>>shift;

It should be noted that maxLuma and minLuma may indicate the maximum andminimum luma samples values of selected positions. Alternatively, theymay indicate a function of maximum and minimum luma samples values ofselected positions, such as averaging. When there are only 4 positionsselected, they may also indicate the average of two larger luma valuesand average of two smaller luma values. Further note that in FIG. 17 ,maxChroma and minChroma represents the chroma values corresponding tomaxLuma and minLuma.

3.3 Method #4 with Up to Four Samples

Suppose the block width and height of current chroma block is W and H,respectively. And the top-left coordinate of current chroma block is [0,0].

If the above and the left blocks are both available and current mode isthe normal LM mode (excluding LM-A, and LM-L), 2 chroma samples locatingat above row, and 2 chroma samples located left column are selected.

The two above samples' coordinates are [floor(W/4), −1] and [floor(3*W/4), −1].

The two left samples' coordinates are [−1, floor(H/4)] and [−1, floor(3*H/4)].

The selected samples are painted in red as depicted in FIG. 31A.

Subsequently, the 4 samples are sorted according to luma sampleintensity and classified into 2 group. The two larger samples and twosmaller samples are respectively averaged. Cross component predictionmodel is derived with the 2 averaged points. Alternatively, the maximumand minimum value of the four samples are used to derive the LMparameters.

If the above block is available while the left block is not available,four chroma samples from above block are selected when W>2 and 2 chromasamples are selected when W=2.

The four selected above samples' coordinates are [W/8, −1], [W/8+W/4,−1], [W/8+2*W/4, −1], and [W/8+3*W/4, −1].

The selected samples are painted in red as depicted in FIG. 31B

If the left block is available while the above block is not available,four chroma samples from left block are selected when H>2 and 2 chromasamples are selected when H=2.

The four selected left samples' coordinates are [−1, H/8], [−1,H/8+H/4], [−1, H/8+2*H/4, −1], and [−1, H/8+3*H/4].

If neither of the left and above blocks are available, a defaultprediction is used. with a equals 0, β equals to 1<<(BitDepth−1), whereBitDepth represents the bit-depth of chroma samples.

If the current mode is the LM-A mode, four chroma samples from aboveblock are selected when W′>2 and 2 chroma samples are selected whenW′=2. W′ is the available number of above neighbouring samples, whichcan be 2*W.

The four selected above samples' coordinates are [W′/8, −1], [W′/8+W′/4,−1], [W′/8+2*W′/4, −1], and [W′/8+3*W′/4, −1].

If the current mode is the LM-L mode, four chroma samples from leftblock are selected when H′>2 and 2 chroma samples are selected whenH′=2. H′ is the available number of left neighbouring samples, which canbe 2*H.

The four selected left samples' coordinates are [−1, H′/8], [−1,H′/8+H′/4], [−1, H′/8+2*H′/4, −1], and [−1, H′/8+3*H′/4].

3.5 Example Embodiment for Modifying Current VVC Standard for Use ofCCLM Prediction.

8.3.4.2.8 Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLMIntra Prediction Mode

The equations are described in this section using the equation numberscorresponding to those in the current draft of the VVC standard.

Inputs to this process are:

-   -   the intra prediction mode predModeIntra,    -   a sample location (xTbC, yTbC) of the top-left sample of the        current transform block relative to the top-left sample of the        current picture,    -   a variable nTbW specifying the transform block width,    -   a variable nTbH specifying the transform block height,    -   chroma neighbouring samples p[x][y], with x=−1, y=0 . . .        2*nTbH−1 and x=0 . . . 2*nTbW−1, y=−1.

Output of this process are predicted samples predSamples[x][y], with x=0. . . nTbW−1, y=0 . . . nTbH−1.

The current luma location (xTbY, yTbY) is derived as follows:(xTbY,yTbY)=(xTbC<<1,yTbC<<1)  (8-155)

The variables availL, availT and availTL are derived as follows:

. . .

-   -   If predModeIntra is equal to INTRA_LT_CCLM, the following        applies:        numSampT=availT?nTbW:0  (8-156)        numSampL=availL?nTbH:0  (8-157)    -   Otherwise, the following applies:        numSampT=(availT&&        predModeIntra==INTRA_T_CCLM)?(nTbW+numTopRight):0   (8-158)        numSampL=(availL&&        predModeIntra==INTRA_L_CCLM)?(nTbH+numLeftBelow):0   (8-159)

The variable bCTUboundary is derived as follows:bCTUboundary=(yTbC&(1<<(Ctb Log 2SizeY−1)−1)==0)?TRUE:FALSE.  (8-160)

The prediction samples predSamples[x][y] with x=0 . . . nTbW−1, y=0 . .. nTbH−1 are derived as follows:

-   -   If both numSampL and numSampT are equal to 0, the following        applies:        predSamples[x][y]=1<<(BitDepth_(C)−1)  (8-161)    -   Otherwise, the following ordered steps apply:

1. . . . [no changes to current specification]

2. . . .

3. . . .

4. . . .

5. . . .

6. [no changes to current specification]

7. The variables minY, maxY, minC and maxC are derived as follows:

-   -   The variable minY is set equal to 1<<(BitDepth_(Y))+1 and the        variable maxY is set equal to 1.    -   If availL is equal to TRUE and predModeIntra is equal to        INTRA_LT_CCLM, the variable aboveIs4 is set equal to 0;        Otherwise, it is set equal to 1.    -   If availT is equal to TRUE and predModeIntra is equal to        INTRA_LT_CCLM, the variable LeftIs4 is set equal to 0;        Otherwise, it is set equal to 1.    -   The variable arrays startPos[ ] and pickStep[ ] are derived as        follows:        startPos[0]=actualTopTemplateSampNum>>(2+aboveIs4);        pickStep[0]=std::max(1, actualTopTemplateSampNum>>(1+aboveIs4));        startPos[1]=actualLeftTemplateSampNum>>(2+leftIs4);        pickStep[1]=std::max(1, actualLeftTemplateSampNum>>(1+leftIs4));    -   The variable cnt is set equal to 0.    -   If predModeIntra is equal to INTRA_LT_CCLM, the variable nSX is        set equal to nTbW, nSY is set equal to nTbH; Otherwise, nSX is        set equal to numSampLT and nSY is set equal to numSampL.    -   If availT is equal to TRUE and predModeIntra is not equal to        INTRA_L_CCLM, the variables selectLumaPix, selectChromaPix are        derived as follows:        -   While startPos[0]+cnt* pickStep[0]<nSX and cnt<4, the            following applies:            -   selectLumaPix[cnt]=pTopDsY[startPos[0]+cnt*                pickStep[0]];            -   selectChromaPix[cnt]=p[startPos[0]+cnt*                pickStep[0]][−1];            -   cnt++;    -   If availL is equal to TRUE and predModeIntra is not equal to        INTRA_T_CCLM, the variables selectLumaPix, selectChromaPix are        derived as follows:        -   While startPos[1]+cnt* pickStep[1]<nSY and cnt<4, the            following applies:            -   selectLumaPix[cnt]=pLeftDsY [startPos[1]+cnt*                pickStep[1]];            -   selectChromaPix[cnt]=p[−1][startPos[1]+cnt*                pickStep[1]];            -   cnt++;    -   If cnt is equal to 2, the following applies:        -   If selectLumaPix[0]>selectLumaPix[1], minY is set equal to            selectLumaPix[1], minC is set equal to selectChromaPix[1],            maxY is set equal to selectLumaPix[0] and maxC is set equal            to selectChromaPix[0]; Otherwise, maxY is set equal to            selectLumaPix[1], maxC is set equal to selectChromaPix[1],            minY is set equal to selectLumaPix[0] and minC is set equal            to selectChromaPix[0]    -   Otherwise, if cnt is equal to 4, the following applies:        -   The variable arrays minGrpIdx and maxGrpIdx are initialized            as:            -   minGrpIdx[0]=0, minGrpIdx[1]=1, maxGrpIdx[0]=2,                maxGrpIdx[1]=3;        -   The following applies            -   If                selectLumaPix[minGrpIdx[0]]>selectLumaPix[minGrpIdx[1]],                swap minGrpIdx[0] and minGrpIdx[1];            -   If                selectLumaPix[maxGrpIdx[0]]>selectLumaPix[maxGrpIdx[1]],                swap maxGrpIdx[0] and maxGrpIdx[1];            -   If                selectLumaPix[minGrpIdx[0]]>selectLumaPix[maxGrpIdx[1]],                swap minGrpIdx and maxGrpIdx;            -   If                selectLumaPix[minGrpIdx[1]]>selectLumaPix[maxGrpIdx[0]],                swap minGrpIdx[1] and maxGrpIdx[0];        -   maxY, maxC, minY and minC are derived as follows:            -   maxY=(selectLumaPix[maxGrpIdx[0]]+selectLumaPix[maxGrpIdx[1]]+1)>>1;            -   maxC=(selectChromaPix[maxGrpIdx[0]]+selectChromaPix[maxGrpIdx[1]]+1)>>1;            -   maxY=(selectLumaPix[minGrpIdx                [0]]+selectLumaPix[minGrpIdx [1]]+1)>>1;            -   maxC=(selectChromaPix[minGrpIdx[0]]+selectChromaPix                [minGrpIdx [1]]+1)>>1;    -   8. The variables a, b, and k are derived as follows:

[end of changes]

3.6 Another Exemplary Working Draft on Proposed CCLM Prediction

In this section, another exemplary embodiment that shows modificationsthat can be made to the current working draft of the VVC standard isdescribed. The equation numbers here refer to the corresponding equationnumbers in the VVC standard.

Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intraprediction mode.

[add to the current VVC working draft as below]

The number of available neighbouring chroma samples on the top andtop-right numTopSamp and the number of available neighbouring chromasamples on the left and left-below nLeftS amp are derived as follows:

-   -   If predModeIntra is equal to INTRA_LT_CCLM, the following        applies:        numSampT=availT?nTbW:0  (8-157)        numSampL=availL?nTbH:0  (8-158)    -   Otherwise, the following applies:        numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0  (8-159)        numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0  (8-160)        The variable bCTUboundary is derived as follows:        bCTUboundary=(yTbC&(1<<(Ctb Log        2SizeY−1)−1)==0)?TRUE:FALSE.  (8-161)        The variable cntN and array pickPosN[ ] with N being replaced by        L and T, are derived as follows:    -   The variable numIs4N is set equal to ((availN &&        predModeIntra==INTRA_LT_CCLM)?0:1).    -   The variable startPosN is set equal to numSampN>>(2+numIs4N).    -   The variable pickStepN is set equal to Max(1,        numSampN>>(1+numIs4N)).    -   If availN is equal to TRUE and predModeIntra is equal to        INTRA_LT_CCLM or INTRA_N_CCLM, cntN is set equal to        (1+numIs4N)<<1, and pickPosN[pos] is set equal to        (startPosN+pos*pickStepN), with pos=0 . . . (cntN−1).    -   Otherwise, cntN is set equal to 0.        The prediction samples predSamples[x][y] with x=0 . . . nTbW−1,        y=0 . . . nTbH−1 are derived as follows:    -   If both numSampL and numSampT are equal to 0, the following        applies:        predSamples[x][y]=1<<(BitDepth_(C)−1)  (8-162)    -   Otherwise, the following ordered steps apply:        -   1. The collocated luma samples pY[x][y] with x=0 . . .            nTbW*2−1, y=0 . . . nTbH*2−1 are set equal to the            reconstructed luma samples prior to the deblocking filter            process at the locations (xTbY+x, yTbY+y).    -   2. The neighbouring luma samples pY[x][y] are derived as        follows:        -   When numSampL is greater than 0, the neighbouring left luma            samples pY[x][y] with x=1 . . . −3, y=0 . . . 2*numSampL−1,            are set equal to the reconstructed luma samples prior to the            deblocking filter process at the locations (xTbY+x, yTbY+y).    -   When numSampT is greater than 0, the neighbouring top luma        samples pY[x][y] with x=0 . . . 2*numSampT−1, y=1, 2, are set        equal to the reconstructed luma samples prior to the deblocking        filter process at the locations (xTbY+x, yTbY+y).        -   When availTL is equal to TRUE, the neighbouring top-left            luma samples pY[x][y] with x=1, y=1, 2, are set equal to the            reconstructed luma samples prior to the deblocking filter            process at the locations (xTbY+x, yTbY+y).    -   3. The down-sampled collocated luma samples pDsY[x][y] with x=0        . . . nTbW−1, y=0 . . . nTbH−1 are derived as follows:        -   If sps_cclm_colocated_chroma_flag is equal to 1, the            following applies:            -   pDsY[x][y] with x=1 . . . nTbW−1, y=1 . . . nTbH−1 is                derived as follows:                pDsY[x][y]=(pY[2*x][2*y−1]+pY[2*x−1][2*y]+4*pY[2*x][2*y]+pY[2*x+1][2*y]+pY[2*x][2*y+1]+4)<<3  (8-163)            -   If availL is equal to TRUE, pDsY[0][y] with y=1 . . .                nTbH−1 is derived as follows:                pDsY[0][y]=(pY[0][2*y−1]+pY[−1][2*y]+4*pY[0][2*y]+pY[1][2*y]+pY[0][2*y+1]±4)<<3  (8-164)            -   Otherwise, pDsY[0][y] with y=1 . . . nTbH−1 is derived                as follows:                pDsY[0][y]=(pY[0][2*y−1]±2*pY[0][2*y]+pY[0][2*y+1]±2)>>2                  (8-165)            -   If availT is equal to TRUE, pDsY[x][0] with x=1 . . .                nTbW−1 is derived as follows:                pDsY[x][0]=(pY[2*x][−1]±pY[2*x−1][0]+4*pY[2*x][0]±pY[2*x+1][0]±pY[2*x][1]±4)>>3  (8-166)            -   Otherwise, pDsY[x][0] with x=1 . . . nTbW−1 is derived                as follows:                pDsY[x][0]=(pY[2*x−1][0]±2*pY[2*x][0]±pY[2*x+1][0]±2)>>2                  (8-167)            -   If availL is equal to TRUE and availT is equal to TRUE,                pDsY[0][0] is derived as follows:                pDsY[0][0]=(pY[0][−1]+pY[−1][0]+4*pY[0][0]+pY[1][0]+pY[0][1]+4)>>3  (8-168)        -   Otherwise if availL is equal to TRUE and availT is equal to            FALSE, pDsY[0][0] is derived as follows:            pDsY[0][0]=(pY[−1][0]+2*pY[0][0]+pY[1][0]+2)>>2  (8-169)            -   Otherwise if availL is equal to FALSE and availT is                equal to TRUE, pDsY[0][0] is derived as follows:                pDsY[0][0]=(pY[0][−1]+2*pY[0][0]+pY[0][1]+2)>>2  (8-170)            -   Otherwise (availL is equal to FALSE and availT is equal                to FALSE), pDsY[0][0] is derived as follows:                pDsY[0][0]=pY[0][0]  (8-171)        -   Otherwise, the following applies:            -   pDsY[x][y] with x=1 . . . nTbW−1, y=0 . . . nTbH−1 is                derived as follows:                pDsY[x][y]=(pY[2*x−1][2*y]+pY[2*x−1][2*y+1]+2*pY[2*x][2*y]+2*pY[2*x][2*y+1]+pY[2*x+1][2*y]+pY[2*x+1][2*y+1]+4)>>3  (8-172)            -   If availL is equal to TRUE, pDsY[0][y] with y=0 . . .                nTbH−1 is derived as follows:                pDsY[0][y]=(pY[1][2*y]+pY[1][2*y+1]+2*pY[0][2*y]+2*pY[0][2*y+1]+pY[1][2*y]+pY[1][2*y+1]+4)>>3  (8-173)            -   Otherwise, pDsY[0][y] with y=0 . . . nTbH−1 is derived                as follows:                pDsY[0][y]=(pY[0][2*y]+pY[0][2*y+1]+1)>>1  (8-174)    -   4. When numSampL is greater than 0, the selected neighbouring        left chroma samples pSelC[idx] are set equal to        p[−1][pickPosL[idx]] with idx=0 . . . (cntL−1), and the selected        down-sampled neighbouring left luma samples pSelDsY[idx] with        idx=0 . . . (cntL−1) are derived as follows:        -   The variable y is set equal to pickPosL[idx].        -   If sps_cclm_colocated_chroma_flag is equal to 1, the            following applies:            -   If y>0 II availTL==TRUE,                pSelDsY[idx]=(pY[2][2*y−1]+pY[3][2*y]+4*pY[2][2*y]+pY[1][2*y]+pY[−2][2*y+1]+4)>>3  (8-175)            -   Otherwise,                pSelDsY[idx]=(pY[3][0]+2*pY[2][0]+pY[1][0]+2)>>2  (8-177)        -   Otherwise, the following applies:            pSelDsY[idx]=(pY[1][2*y]+pY[1][2*y+1]+2*pY[2][2*y]+2*pY[2][2*y+1]+pY[−3][2*y]+pY[−3][2*y+1]+4)>>3  (8-178)    -   5. When numSampT is greater than 0, the selected neighbouring        top chroma samples pSelC[idx] are set equal to        p[pickPosT[idx]][−1] with idx=0 . . . (cntT−1), and the        down-sampled neighbouring top luma samples pSelDsY[idx] with        idx=cntL . . . (cntL+cntT−1) are specified as follows:        -   The variable x is set equal to pickPosT[idx−cntL].        -   If sps_cclm_colocated_chroma_flag is equal to 1, the            following applies:            -   If x>0:                -   If bCTUboundary is equal to FALSE, the following                    applies:                    pSelDsY[idx]=(pY[2*x][3]+pY[2*x−1][2]+4*pY[2*x][2]+pY[2*x+1][2]+pY[2*x][−1]+4)>>3  (8-179)                -   Otherwise (bCTUboundary is equal to TRUE), the                    following applies:                    pSelDsY[idx]=(pY[2*x−1][1]+2*pY[2*x][1]+pY[2*x+1][−1]+2)>>2  (8-180)            -   Otherwise:                -   If availTL is equal to TRUE and bCTUboundary is                    equal to FALSE, the following applies:                    pSelDsY[idx]=(pY[0][3]+pY[1][2]+4*pY[0][2]+pY[1][2]+pY[0][−1]+4)>>3  (8-181)                -   Otherwise if availTL is equal to TRUE and                    bCTUboundary is equal to TRUE, the following                    applies:                    pSelDsY[idx]=(pY[1][1]+2*pY[0][1]+pY[1][−1]+2)>>2  (8-182)                -   Otherwise if availTL is equal to FALSE and                    bCTUboundary is equal to FALSE, the following                    applies:                    pSelDsY[idx]=(pY[0][3]+2*pY[0][2]+pY[0][1]+2)>>2  (8-183)                -   Otherwise (availTL is equal to FALSE and                    bCTUboundary is equal to TRUE), the following                    applies:                    pSelDsY[idx]=pY[0][1]  (8-184)        -   Otherwise, the following applies:            -   If x>0:                -   If bCTUboundary is equal to FALSE, the following                    applies:                    pSelDsY[idx]=(pY[2*x−1][−2]+pY[2*x−1][1]+2*pY[2*x][2]+2*pY[2*x][1]+pY[2*x+1][−2]+pY[2*x+1][−1]+4)>>3  (8-185)                -   Otherwise (bCTUboundary is equal to TRUE), the                    following applies:                    pSelDsY[idx]=(pY[2*x−1][1]+2*                    pY[2*x][1]+pY[2*x+1][−1]+2)>>2  (8-186)            -   Otherwise:                -   If availTL is equal to TRUE and bCTUboundary is                    equal to FALSE, the following applies:                    pSelDsY[idx]=(pY[1][2]+pY[1][1]+2*pY[0][2]+2*pY[0][1]+pY[1][−2]+pY[1][−1]+4)>>3  (8-187)                -   Otherwise if availTL is equal to TRUE and                    bCTUboundary is equal to TRUE, the following                    applies:                    pSelDsY[idx]=(pY[1][1]+2*pY[0][1]+pY[1][−1]+2)>>2  (8-188)                -   Otherwise if availTL is equal to FALSE and                    bCTUboundary is equal to FALSE, the following                    applies:                    pSelDsY[idx]=(pY[0][2]+pY[0][1]+1)>>1  (8-189)                -   Otherwise (availTL is equal to FALSE and                    bCTUboundary is equal to TRUE), the following                    applies:                    pSelDsY[idx]=pY[0][1]  (8-190)    -   6. The variables minY, maxY, minC and maxC are derived as        follows:        -   When cntT+cntL is equal to 2, set pSelC[idx+2]=pSelC[idx]            and pSelDsY[idx+2]=pSelDsY[idx], with idx=0 and 1.        -   The arrays minGrpIdx[ ] and maxGrpIdx[ ] are set as:            minGrpIdx[0]=0, minGrpIdx[1]=1, maxGrpIdx[0]=2,            maxGrpIdx[1]=3.        -   If pSelDsY[minGrpIdx[0]]>pSelDsY[minGrpIdx[1]],            Swap(minGrpIdx[0], minGrpIdx[1]).        -   If pSelDsY[maxGrpIdx[0]]>pSelDsY[maxGrpIdx[1]],            Swap(maxGrpIdx[0], maxGrpIdx[1]).        -   If pSelDsY[minGrpIdx[0]]>pSelDsY[maxGrpIdx[1]],            Swap(minGrpIdx, maxGrpIdx).        -   If pSelDsY[minGrpIdx[1]]>pSelDsY[maxGrpIdx[0]],            Swap(minGrpIdx[1], maxGrpIdx[0]).        -   maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1.        -   maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1.        -   minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1.        -   minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1.    -   7. The variables a, b, and k are derived as follows:        -   If numSampL is equal to 0, and numSampT is equal to 0, the            following applies:            k=0  (8-208)            a=0  (8-209)            b=1<<(BitDepth_(C)−1)  (8-210)        -   Otherwise, the following applies:            diff=maxY−minY  (8-211)            -   If diff is not equal to 0, the following applies:                diffC=maxC−minC  (8-212)                x=Floor(Log 2(diff))  (8-213)                normDiff=((diff<<4)>>x) & 15  (8-214)                x+=(normDiff!=0)?1:0  (8-215)                y=Floor(Log 2(Abs(diffC)))+1  (8-216)                a=(diffC*(divSigTable[normDiff]|8)+2^(y-1))>>y  (8-217)                k=((3+x−y)<1)?1:3+x−y  (8-218)                a=((3+x−y)<1)?Sign(a)*15:a  (8-219)                b=minC−((a*minY)>>k)  (8-220)                -   where divSigTable[ ] is specified as follows:                    divSigTable[                    ]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0}  (8-221)            -   Otherwise (diff is equal to 0), the following applies:                k=0  (8-222)                a=0  (8-223)                b=minC  (8-224)    -   8. The prediction samples predSamples[x][y] with x=0 . . .        nTbW−1, y=0 . . . nTbH−1 are derived as follows:        predSamples[x][y]=Clip1C(((pDsY[x][y]*a)>>k)+b)  (8-225)

[End of the Embodiment Example]

3.7 Another Exemplary Working Draft on Proposed CCLM Prediction

In this section, another exemplary embodiment that shows modificationsthat can be made to the current working draft of the VVC standard isdescribed. The equation numbers here refer to the corresponding equationnumbers in the VVC standard.

Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intraprediction mode

The number of available neighbouring chroma samples on the top andtop-right numTopSamp and the number of available neighbouring chromasamples on the left and left-below nLeftS amp are derived as follows:

-   -   If predModeIntra is equal to INTRA_LT_CCLM, the following        applies:        numSampT=availT?nTbW:0  (8-157)        numSampL=availL?nTbH:0  (8-158)    -   Otherwise, the following applies:        numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0  (8-159)        numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0  (8-160)        The variable bCTUboundary is derived as follows:        bCTUboundary=(yTbC&(1<<(Ctb Log        2SizeY−1)−1)==0)?TRUE:FALSE.  (8-161)        The variable cntN and array pickPosN[ ] with N being replaced by        L and T, are derived as follows:    -   The variable numIs4N is set equal to ((availN &&        predModeIntra==INTRA_LT_CCLM)?0:1).    -   The variable startPosN is set equal to numSampN>>(2+numIs4N).    -   The variable pickStepN is set equal to Max(1,        numSampN>>(1+numIs4N)).

If availN is equal to TRUE and predModeIntra is equal to INTRA_LT_CCLMor INTRA_N_CCLM, cntN is set equal to Min(numSampN, (1+numIs4N)<<1), andpickPosN[pos] is set equal to (startPosN+pos*pickStepN), with pos=0 . .. (cntN−1).

-   -   Otherwise, cntN is set equal to 0.        The prediction samples predSamples[x][y] with x=0 . . . nTbW−1,        y=0 . . . nTbH−1 are derived as follows:    -   If both numSampL and numSampT are equal to 0, the following        applies:        predSamples[x][y]=1<<(BitDepth_(C)−1)  (8-162)    -   Otherwise, the following ordered steps apply:        -   1. The collocated luma samples pY[x][y] with x=0 . . .            nTbW*2−1, y=0 . . . nTbH*2−1 are set equal to the            reconstructed luma samples prior to the deblocking filter            process at the locations (xTbY+x, yTbY+y).        -   2. The neighbouring luma samples pY[x][y] are derived as            follows:            -   When numSampL is greater than 0, the neighbouring left                luma samples pY[x][y] with x=−1 . . . −3, y=0 . . .                2*numSampL−1, are set equal to the reconstructed luma                samples prior to the deblocking filter process at the                locations (xTbY+x, yTbY+y).            -   When numSampT is greater than 0, the neighbouring top                luma samples pY[x][y] with x=0 . . . 2*numSampT−1, y=1,                2, are set equal to the reconstructed luma samples prior                to the deblocking filter process at the locations                (xTbY+x, yTbY+y).            -   When availTL is equal to TRUE, the neighbouring top-left                luma samples pY[x][y] with x=−1, y=−1, −2, are set equal                to the reconstructed luma samples prior to the                deblocking filter process at the locations (xTbY+x,                yTbY+y).    -   3. The down-sampled collocated luma samples pDsY[x][y] with x=0        . . . nTbW−1, y=0 . . . nTbH−1 are derived as follows:        -   If sps_cclm_colocated_chroma_flag is equal to 1, the            following applies:            -   pDsY[x][y] with x=1 . . . nTbW−1, y=1 . . . nTbH−1 is                derived as follows:                pDsY[x][y]=(pY[2*x][2*y−1]+pY[2*x−1][2*y]+4*pY[2*x][2*y]+pY[2*x+1][2*y]+pY[2*x][2*y+1]+4)>>3  (8-163)            -   If availL is equal to TRUE, pDsY[0][y] with y=1 . . .                nTbH−1 is derived as follows:                pDsY[0][y]=(pY[0][2*y−1]+pY[−1][2*y]+4*pY[0][2*y]+pY[1][2*y]+pY[0][2*y+1]±4)>>3  (8-164)            -   Otherwise, pDsY[0][y] with y=1 . . . nTbH−1 is derived                as follows:                pDsY[0][y]=(pY[0][2*y−1]±2*pY[0][2*y]+pY[0][2*y+1]±2)>>2                  (8-165)            -   If availT is equal to TRUE, pDsY[x][0] with x=1 . . .                nTbW−1 is derived as follows:                pDsY[x][0]=(pY[2*x][−1]±pY[2*x−1][0]+4*pY[2*x][0]±pY[2*x+1][0]±pY[2*x][1]±4)>>3  (8-166)            -   Otherwise, pDsY[x][0] with x=1 . . . nTbW−1 is derived                as follows:                pDsY[x][0]=(pY[2*x−1][0]+2*pY[2*x][0]±pY[2*x+1][0]±2)>>2                  (8-167)            -   If availL is equal to TRUE and availT is equal to TRUE,                pDsY[0][0] is derived as follows:                pDsY[0][0]=(pY[0][−1]+pY[−1][0]+4*pY[0][0]±pY[1][0]±pY[0][1]±4)>>3  (8-168)            -   Otherwise if availL is equal to TRUE and availT is equal                to FALSE, pDsY[0][0] is derived as follows:                pDsY[0][0]=(pY[1][0]±2*pY[0][0]±pY[1][0]±2)>>2  (8-169)            -   Otherwise if availL is equal to FALSE and availT is                equal to TRUE, pDsY[0][0] is derived as follows:                pDsY[0][0]=(pY[0][−1]±2*pY[0][0]±pY[0][1]±2)>>2  (8-170)            -   Otherwise (availL is equal to FALSE and availT is equal                to FALSE), pDsY[0][0] is derived as follows:                pDsY[0][0]=pY[0][0]  (8-171)        -   Otherwise, the following applies:            -   pDsY[x][y] with x=1 . . . nTbW−1, y=0 . . . nTbH−1 is                derived as follows:                pDsY[x][y]=(pY[2*x−1][2*y]+pY[2*x−1][2*y+1]+2*pY[2*x][2*y]+2*pY[2*x][2*y+1]+pY[2*x+1][2*y]+pY[2*x+1][2*y+1]+4)>>3  (8-172)            -   If availL is equal to TRUE, pDsY[0][y] with y=0 . . .                nTbH−1 is derived as follows:                pDsY[0][y]=(pY[1][2*y]+pY[1][2*y+1]+2*pY[0][2*y]+2*pY[0][2*y+1]+pY[1][2*y]+pY[1][2*y+1]+4)>>3  (8-173)            -   Otherwise, pDsY[0][y] with y=0 . . . nTbH−1 is derived                as follows:                pDsY[0][y]=(pY[0][2*y]+pY[0][2*y+1]+1)>>1  (8-174)    -   4. When numSampL is greater than 0, the selected neighbouring        left chroma samples pSelC[idx] are set equal to        p[−1][pickPosL[idx]] with idx=0 . . . (cntL 1), and the selected        down-sampled neighbouring left luma samples pSelDsY[idx] with        idx=0 . . . (cntL-1) are derived as follows:        -   The variable y is set equal to pickPosL[idx].        -   If sps_cclm_colocated_chroma_flag is equal to 1, the            following applies:            -   If y>0 II availTL==TRUE,                pSelDsY[idx]=(pY[2][2*y−1]+pY[3][2*y]+4*pY[2][2*y]+pY[1][2*y]+pY[2][2*y+1]+4)>>3  (8-175)            -   Otherwise,                pSelDsY[idx]=(pY[3][0]+2*pY[2][0]+pY[1][0]+2)>>2  (8-177)        -   Otherwise, the following applies:            pSelDsY[idx]=(pY[−1][2*y]+pY[−1][2*y+1]+2*pY[−2][2*y]+2*pY[−2][2*y+1]+pY[−3][2*y]+pY[−3][2*y+1]+4)>>3  (8-178)    -   5. When numSampT is greater than 0, the selected neighbouring        top chroma samples pSelC[idx] are set equal to        p[pickPosT[idx]][−1] with idx=0 . . . (cntT−1), and the        down-sampled neighbouring top luma samples pSelDsY[idx] with        idx=cntL . . . (cntL+cntT−1) are specified as follows:        -   The variable x is set equal to pickPosT[idx−cntL].        -   If sps_cclm_colocated_chroma_flag is equal to 1, the            following applies:            -   If x>0:                -   If bCTUboundary is equal to FALSE, the following                    applies:                    pSelDsY[idx]=(pY[2*x][3]+pY[2*x−1][−2]+4*pY[2*x][−2]+pY[2*x+1][−2]+pY[2*x][−1]+4)>>3  (8-179)                -   Otherwise (bCTUboundary is equal to TRUE), the                    following applies:                    pSelDsY[idx]=(pY[2*x−1][1]+2*pY[2*x][−1]+pY[2*x+1][−1]+2)>>2  (8-180)            -   Otherwise:                -   If availTL is equal to TRUE and bCTUboundary is                    equal to FALSE, the following applies:                    pSelDsY[idx]=(pY[0][−3]+pY[−1][−2]+4*pY[0][−2]+pY[1][−2]+pY[0][−1]+4)»3  (8-181)                -   Otherwise if availTL is equal to TRUE and                    bCTUboundary is equal to TRUE, the following                    applies:                    pSelDsY[idx]=(pY[−1][−1]+2*pY[0][−1]+pY[1][−1]+2)>>2  (8-182)                -   Otherwise if availTL is equal to FALSE and                    bCTUboundary is equal to FALSE, the following                    applies:                    pSelDsY[idx]=(pY[0][−3]+2*pY[0][−2]+pY[0][−1]+2)>>2  (8-183)                -   Otherwise (availTL is equal to FALSE and                    bCTUboundary is equal to TRUE), the following                    applies:                    pSelDsY[idx]=pY[0][−1]  (8-184)        -   Otherwise, the following applies:            -   If x>0:                -   If bCTUboundary is equal to FALSE, the following                    applies:                    pSelDsY[idx]=(pY[2*x−1][2]+pY[2*x−1][1]+2*pY[2*x][−2]+2*pY[2*x][−1]+pY[2*x+1][−2]+pY[2*x+1][−1]+4)>>3  (8-185)                -   Otherwise (bCTUboundary is equal to TRUE), the                    following applies:                    pSelDsY[idx]=(pY[2*x−1][−1]+2*pY[2*x][−1]+pY[2*x+1][−1]+2)>>2  (8-186)            -   Otherwise:                -   If availTL is equal to TRUE and bCTUboundary is                    equal to FALSE, the following applies:                    pSelDsY[idx]=(pY[−1][−2]+pY[−1][−1]+2*pY[0][−2]+2*pY[0][−1]+pY[1][−2]+pY[1][−1]+4)>>3  (8-187)                -   Otherwise if availTL is equal to TRUE and                    bCTUboundary is equal to TRUE, the following                    applies:                    pSelDsY[idx]=pY[−1][−1]+2*pY[0][−1]+pY[1][−1]+2)>>2  (8-188)                -   Otherwise if availTL is equal to FALSE and                    bCTUboundary is equal to FALSE, the following                    applies:                    pSelDsY[idx]=(pY[0][−2]+pY[0][−1]+1)>>1  (8-189)                -   Otherwise (availTL is equal to FALSE and                    bCTUboundary is equal to TRUE), the following                    applies:                    pSelDsY[idx]=pY[0][−1]  (8-190)    -   6. When cntT+cntL is not equal to 0, the variables minY, maxY,        minC and maxC are derived as follows:        -   When cntT+cntL is equal to 2, set pSelComp[3] equal to            pSelComp [0], pSelComp[2] equal to pSelComp[1], pSelComp[0]            equal to pSelComp [1], and pSelComp[1] equal to pSelComp[3],            with Comp being replaced by DsY and C.        -   The arrays minGrpIdx[ ] and maxGrpIdx[ ] are set as:            minGrpIdx[0]=0, minGrpIdx[1]=1, maxGrpIdx[0]=2,            maxGrpIdx[1]=3.        -   If pSelDsY[minGrpIdx[0]]>pSelDsY[minGrpIdx[1]],            Swap(minGrpIdx[0], minGrpIdx[1]).        -   If pSelDsY[maxGrpIdx[0]]>pSelDsY[maxGrpIdx[1]],            Swap(maxGrpIdx[0], maxGrpIdx[1]).        -   If pSelDsY[minGrpIdx[0]]>pSelDsY[maxGrpIdx[1]],            Swap(minGrpIdx, maxGrpIdx)        -   If pSelDsY[minGrpIdx[1]]>pSelDsY[maxGrpIdx[0]],            Swap(minGrpIdx[1], maxGrpIdx[0]).        -   maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1.        -   maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1.        -   minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1.        -   minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1.    -   7. The variables a, b, and k are derived as follows:        -   If numSampL is equal to 0, and numSampT is equal to 0, the            following applies:            k=0  (8-208)            a=0  (8-209)            b=1<<(BitDepth_(C)−1)  (8-210)        -   Otherwise, the following applies:            diff=maxY−minY  (8-211)            -   If diff is not equal to 0, the following applies:                diffC=maxC−minC  (8-212)                x=Floor(Log 2(diff))  (8-213)                normDiff=((diff<<4)>>x) & 15  (8-214)                x+=(normDiff!=0)?1:0  (8-215)                y=Floor(Log 2(Abs(diffC)))+1  (8-216)                a=(diffC*(divSigTable[normDiff]|8)+2^(y-1))>>y  (8-217)                k=((3+x−y)<1)?1:3+x−y  (8-218)                a=((3+x−y)<1)?Sign(a)*15: a  (8-219)                b=minC−((a*minY)>>k)  (8-220)                -   where divSigTable[ ] is specified as follows:                    divSigTable[                    ]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0}  (8-221)            -   Otherwise (diff is equal to 0), the following applies:                k=0  (8-222)                a=0  (8-223)                b=minC  (8-224)    -   8. The prediction samples predSamples[x][y] with x=0 . . .        nTbW−1, y=0 . . . nTbH−1 are derived as follows:        predSamples[x][y]=Clip1C(((pDsY[x][y]*a)>>k)+b)  (8-225)

3.8 an Alternative Working Draft on Proposed CCLM Prediction

In this section, an alternative exemplary embodiment that shows anothermodifications that can be made to the current working draft of the VVCstandard is described. The equation numbers here refer to thecorresponding equation numbers in the VVC standard.

Specification of INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM intraprediction mode.

. . .

The number of available neighbouring chroma samples on the top andtop-right numTopSamp and the number of available neighbouring chromasamples on the left and left-below nLeftS amp are derived as follows:

-   -   If predModeIntra is equal to INTRA_LT_CCLM, the following        applies:        numSampT=availT?nTbW:0  (8-157)        numSampL=availL?nTbH:0  (8-158)    -   Otherwise, the following applies:        numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+Min(numTopRight,nTbH)):0  (8-159)        numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+Min(numLeftBelow,nTbW)):0  (8-160)

The variable bCTUboundary is derived as follows:bCTUboundary=(yTbC&(1<<(Ctb Log 2SizeY−1)−1)==0)?TRUE:FALSE.  (8-161)The variable cntN and array pickPosN[ ] with N being replaced by L andT, are derived as follows:

-   -   The variable numIs4N is set equal to ((availT && availL &&        predModeIntra==INTRA_LT_CCLM)?0:1).    -   The variable startPosN is set equal to numSampN>>(2+numIs4N).    -   The variable pickStepN is set equal to Max(1,        numSampN>>(1+numIs4N)).    -   If availN is equal to TRUE and predModeIntra is equal to        INTRA_LT_CCLM or INTRA_N_CCLM, cntN is set equal to        Min(numSampN, (1+numIs4N)<<1), and pickPosN[pos] is set equal to        (startPosN+pos*pickStepN), with pos=0 . . . (cntN 1).    -   Otherwise, cntN is set equal to 0.        The prediction samples predSamples[x][y] with x=0 . . . nTbW−1,        y=0 . . . nTbH−1 are derived as follows:    -   If both numSampL and numSampT are equal to 0, the following        applies:        predSamples[x][y]=1<<(BitDepth_(C)−1)  (8-162)    -   Otherwise, the following ordered steps apply:    -   1. The collocated luma samples pY[x][y] with x=0 . . . nTbW*2−1,        y=0 . . . nTbH*2−1 are set equal to the reconstructed luma        samples prior to the deblocking filter process at the locations        (xTbY+x, yTbY+y).    -   2. The neighbouring luma samples pY[x][y] are derived as        follows:        -   When numSampL is greater than 0, the neighbouring left luma            samples pY[x][y] with x=1 . . . −3, y=0 . . . 2*numSampL 1,            are set equal to the reconstructed luma samples prior to the            deblocking filter process at the locations (xTbY+x, yTbY+y).        -   When numSampT is greater than 0, the neighbouring top luma            samples pY[x][y] with x=0 . . . 2*numSampT−1, y=−1, −2, are            set equal to the reconstructed luma samples prior to the            deblocking filter process at the locations (xTbY+x, yTbY+y).        -   When availTL is equal to TRUE, the neighbouring top-left            luma samples pY[x][y] with x=1, y=1, 2, are set equal to the            reconstructed luma samples prior to the deblocking filter            process at the locations (xTbY+x, yTbY+y).    -   3. The down-sampled collocated luma samples pDsY[x][y] with x=0        . . . nTbW−1, y=0 . . . nTbH−1 are derived as follows:        -   If sps_cclm_colocated_chroma_flag is equal to 1, the            following applies:            -   pDsY[x][y] with x=1 . . . nTbW−1, y=1 . . . nTbH−1 is                derived as follows:                pDsY[x][y]=(pY[2*x][2*y−1]+pY[2*x−1][2*y]+4*pY[2*x][2*y]+pY[2*x+1][2*y]+pY[2*x][2*y+1]±4)>>3  (8-163)            -   If availL is equal to TRUE, pDsY[0][y] with y=1 . . .                nTbH−1 is derived as follows:                pDsY[0][y]=(pY[0][2*y−1]+pY[−1][2*y]+4*pY[0][2*y]+pY[1][2*y]+pY[0][2*y+1]±4)>>3  (8-164)            -   Otherwise, pDsY[0][y] with y=1 . . . nTbH−1 is derived                as follows:                pDsY[0][y]=(pY[0][2*y−1]±2*pY[0][2*y]+pY[0][2*y+1]±2)>>2                  (8-165)            -   If availT is equal to TRUE, pDsY[x][0] with x=1 . . .                nTbW−1 is derived as follows:                pDsY[x][0]=(pY[2*x][−1]±pY[2*x−1][0]+4*pY[2*x][0]±pY[2*x+1][0]±pY[2*x][1]±4)>>3  (8-166)            -   Otherwise, pDsY[x][0] with x=1 . . . nTbW−1 is derived                as follows:                pDsY[x][0]=(pY[2*x−1][0]+2*pY[2*x][0]+pY[2*x+1][0]+2)>>2                  (8-167)            -   If availL is equal to TRUE and availT is equal to TRUE,                pDsY[0][0] is derived as follows:                pDsY[0][0]=(pY[0][−1]+pY[−1][0]+4*pY[0][0]+pY[1][0]+pY[0][1]+4)>>3  (8-168)            -   Otherwise if availL is equal to TRUE and availT is equal                to FALSE, pDsY[0][0] is derived as follows:                pDsY[0][0]=(pY[−1][0]+2*pY[0][0]+pY[1][0]+2)>>2  (8-169)            -   Otherwise if availL is equal to FALSE and availT is                equal to TRUE, pDsY[0][0] is derived as follows:                pDsY[0][0]=(pY[0][−1]+2*pY[0][0]+pY[0][1]+2)>>2  (8-170)            -   Otherwise (availL is equal to FALSE and availT is equal                to FALSE), pDsY[0][0] is derived as follows:                pDsY[0][0]=pY[0][0]  (8-171)        -   Otherwise, the following applies:            -   pDsY[x][y] with x=1 . . . nTbW−1, y=0 . . . nTbH−1 is                derived as follows:                pDsY[x][y]=(pY[2*x−1][2*y]+pY[2*x−1][2*y+1]+2*pY[2*x][2*y]+2*pY[2*x][2*y+1]+pY[2*x+1][2*y]+pY[2*x+1][2*y+1]+4)>>3  (8-172)            -   If availL is equal to TRUE, pDsY[0][y] with y=0 . . .                nTbH−1 is derived as follows:                pDsY[0][y]=(pY[1][2*y]+pY[1][2*y+1]+2*pY[0][2*y]+2*pY[0][2*y+1]+pY[1][2*y]+pY[1][2*y+1]+4)>>3  (8-173)            -   Otherwise, pDsY[0][y] with y=0 . . . nTbH−1 is derived                as follows:                pDsY[0][y]=(pY[0][2*y]+pY[0][2*y+1]+1)>>1  (8-174)    -   4. When numSampL is greater than 0, the selected neighbouring        left chroma samples pSelC[idx] are set equal to        p[−1][pickPosL[idx]] with idx=0 . . . (cntL 1), and the selected        down-sampled neighbouring left luma samples pSelDsY[idx] with        idx=0 . . . (cntL-1) are derived as follows:        -   The variable y is set equal to pickPosL[idx].        -   If sps_cclm_colocated_chroma_flag is equal to 1, the            following applies:            -   If y>0∥availTL==TRUE, pSelDsY[idx]=(pY[2][2*y−1]+                pSelDsY[idx]=(pY[−2][2*y−1]+pY[−3][2*y]+4*pY[−2][2*y]+pY[−1][2*y]+pY[−2][2*y+1]+4)>>3  (8-175)            -   Otherwise,                pSelDsY[idx]=(pY[−3][0]+2*pY[−2][0]+pY[−1][0]+2)>>2  (8-177)        -   Otherwise, the following applies:            pSelDsY[idx]=(pY[−1][2*y]+pY[−1][2*y+1]+2*pY[−2][2*y]+2*pY[−2][2*y+1]+pY[−3][2*y]+pY[−3][2*y+1]+4)>>3  (8-178)    -   5. When numSampT is greater than 0, the selected neighbouring        top chroma samples pSelC[idx] are set equal to        p[pickPosT[idx−cntL]][−1] with idx=cntL . . . (cntL+cntT−1), and        the down-sampled neighbouring top luma samples pSelDsY[idx] with        idx=cntL . . . (cntL+cntT−1) are specified as follows:        -   The variable x is set equal to pickPosT[idx−cntL].        -   If sps_cclm_colocated_chroma_flag is equal to 1, the            following applies:            -   If x>0:                -   If bCTUboundary is equal to FALSE, the following                    applies:                    pSelDsY[idx]=(pY[2*x][−3]+pY[2*x−1][−2]+4*pY[2*x][−2]+pY[2*x+1][−2]+pY[2*x][−1]+4)>>3  (8-179)                -   Otherwise (bCTUboundary is equal to TRUE), the                    following applies:                    pSelDsY[idx]=(pY[2*x−1][−1]+2*pY[2*x][−1]+pY[2*x+1][−1]+2)>>2  (8-180)            -   Otherwise:                -   If availTL is equal to TRUE and bCTUboundary is                    equal to FALSE, the following applies:                    pSelDsY[idx]=(pY[0][−3]+pY[−1][−2]+4*pY[0][−2]+pY[1][−2]+pY[0][−1]+4)>>3  (8-181)                -   Otherwise if availTL is equal to TRUE and                    bCTUboundary is equal to TRUE, the following                    applies:                    pSelDsY[idx]=(pY[−1][−1]+2*pY[0][−1]+pY[1][−1]+2)>>2  (8-182)                -   Otherwise if availTL is equal to FALSE and                    bCTUboundary is equal to FALSE, the following                    applies:                    pSelDsY[idx]=(pY[0][−3]+2*pY[0][−2]+pY[0][−1]+2)>>2  (8-183)                -   Otherwise (availTL is equal to FALSE and                    bCTUboundary is equal to TRUE), the following                    applies:                    pSelDsY[idx]=pY[0][−1]  (8-184)        -   Otherwise, the following applies:            -   If x>0:                -   If bCTUboundary is equal to FALSE, the following                    applies:                    pSelDsY[idx]=(pY[2*x−1][−2]+pY[2*x−1][−1]+2*pY[2*x][−2]+2*pY[2*x][−1]+pY[2*x+1][−2]+pY[2*x+1][−1]+4)»3  (8-185)                -   Otherwise (bCTUboundary is equal to TRUE), the                    following applies:                    pSelDsY[idx]=(pY[2*x−1][−1]+2*pY[2*x][1]+pY[2*x+1][−1]+2)>>2  (8-186)            -   Otherwise:                -   If availTL is equal to TRUE and bCTUboundary is                    equal to FALSE, the following applies:                    pSelDsY[idx]=(pY[1][−2]+pY[−1][−1]+2*pY[0][−2]+2*pY[0][−1]+pY[1][−2]+pY[1][−1]+4)>>3  (8-187)                -   Otherwise if availTL is equal to TRUE and                    bCTUboundary is equal to TRUE, the following                    applies:                    pSelDsY[idx]=(pY[−1][−1]+2*pY[0][−1]+pY[1][−1]+2)>>2  (8-188)                -   Otherwise if availTL is equal to FALSE and                    bCTUboundary is equal to FALSE, the following                    applies:                    pSelDsY[idx]=(pY[0][−2]+pY[0][−1]+1)>>1  (8-189)                -   Otherwise (availTL is equal to FALSE and                    bCTUboundary is equal to TRUE), the following                    applies:                    pSelDsY[idx]=pY[0][−1]  (8-190)    -   6. When cntT+cntL is not equal to 0, the variables minY, maxY,        minC and maxC are derived as follows:        -   When cntT+cntL is equal to 2, set pSelComp[3] equal to            pSelComp [0], pSelComp[2] equal to pSelComp[1], pSelComp[0]            equal to pSelComp [1], and pSelComp[1] equal to pSelComp[3],            with Comp being replaced by DsY and C.        -   The arrays minGrpIdx[ ] and maxGrpIdx[ ] are set as:            minGrpIdx[0]=0, minGrpIdx[1]=2, maxGrpIdx[0]=1,            maxGrpIdx[1]=3.        -   If pSelDsY[minGrpIdx[0]]>pSelDsY[minGrpIdx[1]],            Swap(minGrpIdx[0], minGrpIdx[1]).        -   If pSelDsY[maxGrpIdx[0]]>pSelDsY[maxGrpIdx[1]],            Swap(maxGrpIdx[0], maxGrpIdx[1]).        -   If pSelDsY[minGrpIdx[0]]>pSelDsY[maxGrpIdx[1]],            Swap(minGrpIdx, maxGrpIdx)        -   If pSelDsY[minGrpIdx[1]]>pSelDsY[maxGrpIdx[0]],            Swap(minGrpIdx[1], maxGrpIdx[0]).        -   maxY=(pSelDsY[maxGrpIdx[0]]+pSelDsY[maxGrpIdx[1]]+1)>>1.        -   maxC=(pSelC[maxGrpIdx[0]]+pSelC[maxGrpIdx[1]]+1)>>1.        -   minY=(pSelDsY[minGrpIdx[0]]+pSelDsY[minGrpIdx[1]]+1)>>1.        -   minC=(pSelC[minGrpIdx[0]]+pSelC[minGrpIdx[1]]+1)>>1.    -   7. The variables a, b, and k are derived as follows:        -   If numSampL is equal to 0, and numSampT is equal to 0, the            following applies:            k=0  (8-208)            a=0  (8-209)            b=1<<(BitDepth_(C)−1)  (8-210)        -   Otherwise, the following applies:            diff=maxY−minY  (8-211)            -   If diff is not equal to 0, the following applies:                diffC=maxC−minC  (8-212)                x=Floor(Log 2(diff))  (8-213)                normDiff=((diff<<4)>>x) & 15  (8-214)                x+=(normDiff!=0)?1:0  (8-215)                y=Floor(Log 2(Abs(diffC)))+1  (8-216)                a=(diffC*(divSigTable[normDiff]18)+2^(y-1))>>y  (8-217)                k=((3+x−y)<1)?1:3+x−y  (8-218)                a=((3+x−y)<1)?Sign(a)*15:a  (8-219)                b=minC−((a*minY)>>k)  (8-220)                -   where divSigTable[ ] is specified as follows:                    divSigTable[                    ]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0}  (8-221)            -   Otherwise (diff is equal to 0), the following applies:                k=0  (8-222)                a=0  (8-223)                b=minC  (8-224)    -   8. The prediction samples predSamples[x][y] with x=0 . . .        nTbW−1, y=0 . . . nTbH−1 are derived as follows:        predSamples[x][y]=Clip1C(((pDsY[x][y]*a)>>k)+b)  (8-225)

The examples described above may be incorporated in the context of themethods described below, e.g., methods 1800 to 2930, which may beimplemented at a video encoder and/or decoder.

FIG. 18 shows a flowchart of an exemplary method for video processing.The method 1800 includes, at step 1802, determining, for a conversionbetween a current video block of a video that is a chroma block and acoded representation of the video, parameters of a cross-componentlinear model based on two chroma samples from a group of neighboringchroma samples, wherein the two chroma samples are selected from thegroup based on a position rule. The method 1800 further includes, atstep 1804, performing the conversion based on the determining.

FIG. 19A shows a flowchart of an exemplary method for video processing.The method 1900 includes, at step 1902, determining, for a conversionbetween a current video block of a video that is a chroma block and acoded representation of the video, parameters of a cross-componentlinear model based on selected chroma samples based on positions of thechroma samples, wherein the selected chroma samples are selected from agroup of neighboring chroma samples. The method 1900 further includes,at step 1804, performing the conversion based on the determining.

FIG. 19B shows a flowchart of an exemplary method for video processing.The method 1910 includes, at step 1912, determining, for a current videoblock, a group of neighboring chroma samples used to derive a set ofvalues for parameters of a linear model, wherein a width and a height ofthe current video block is W and H, respectively, and wherein the groupof neighboring chroma samples comprises at least one sample that islocated beyond 2×W above neighboring chroma samples or 2×H leftneighboring chroma samples. The method 1910 further includes, at step1914, performing, based on the linear model, a conversion between thecurrent video block and a coded representation of a video including thecurrent video block.

FIG. 20A shows a flowchart of an exemplary method for video processing.The method 2000 includes, at step 2002, determining, for a conversionbetween a current video block of a video that is a chroma block and acoded representation of the video, multiple sets of parameters, whereineach set of parameters defines a cross-component linear model (CCLM) andis derived from a corresponding group of chroma samples at correspondingchroma sample positions. The method 2000 further includes, at step 2004,determining, based on the multiple sets of parameters, parameters for afinal CCLM. The method 2000 further includes, at step 2006, performingthe conversion based on the final CCLM.

FIG. 20B shows a flowchart of an exemplary method for video processing.The method 2010 includes, at step 2012, determining, for a conversionbetween a current video block of a video and a coded representation ofthe video, parameters of a cross-component linear model (CCLM) based onmaximum and minimum values of chroma and luma samples of N groups ofchroma and luma samples selected from neighboring luma and chromasamples of the current video block. The method 2010 further includes, atstep 2014, performing the conversion using the CCLM.

FIG. 21 shows a flowchart of an exemplary method for video processing.The method 2100 includes, at step 2102, determining, for a conversionbetween a current video block of a video that is a chroma block and acoded representation of the video, parameters of a cross-componentlinear model that are completely determinable by two chroma samples andcorresponding two luma samples. The method 2100 further includes, atstep 2104, performing the conversion based on the determining.

FIG. 22 shows a flowchart of an exemplary method for video processing.The method 2200 includes, at step 2202, determining, for a conversionbetween a current video block of a video that is a chroma block and acoded representation of the video, parameters of a cross-componentlinear model using a parameter table whose entries are retrievedaccording to two chroma sample values and two luma sample values. Themethod 220 further includes, at step 2204, performing the conversionbased on the determining.

FIG. 23A shows a flowchart of an exemplary method for video processing.The method 2310 includes, at step 2312, determining, for a conversionbetween a current video block of a video that is a chroma block and acoded representation of the video, a final prediction P(x, y) of achroma sample at a position (x, y) in the current video block as acombination of prediction results of multiple cross-component linearmodels (MCCLMs), wherein the MCCLMs are selected based on the position(x, y) of the chroma sample. The method 2310 further includes, at step2314, performing the conversion based on the final prediction.

FIG. 23B shows a flowchart of an exemplary method for video processing.The method 2320 includes, at step 2322, performing, for a conversionbetween a current video block of a video that is a chroma block and acoded representation of the video, a first determination regardingwhether a first cross-component linear model (CCLM) that uses onlyleft-neighboring samples is used for predicting samples of the currentvideo block and/or a second determination regarding whether a secondcross-component linear model (CCLM) that uses only above-neighboringsamples is used for predicting samples of the current video block. Themethod 2320 further includes, at step 2324, performing the conversionbased on the first determination and/or the second determination.

FIG. 24A shows a flowchart of an exemplary method for video processing.The method 2410 includes, at step 2412, determining, for a conversionbetween a current video block of a video and a coded representation ofthe video, a context that is used to code a flag using arithmetic codingin the coded representation of the current video block, wherein thecontext is based on whether a top-left neighboring block of the currentvideo block is coded using a cross-component linear model (CCLM)prediction mode. The method 2410 includes, at step 2414, performing theconversion based on the determining. In some implementations, whereinthe flag is signaled to indicate whether the CCLM prediction mode isapplied on the current video block, and wherein the CCLM prediction modeuses a linear mode to derive prediction values of a chroma componentfrom another component.

FIG. 24B shows a flowchart of an exemplary method for video processing.The method 2420 includes, at step 2422, determining, for a conversionbetween a current video block of a video and a coded representation ofthe video, a coding order for one or more indications of a derived mode(DM mode) and a linear mode (LM mode) based on a coding mode of one ormore neighboring blocks of the current video block. The method 2420includes, at step 2424, performing the conversion based on thedetermining. In some implementations, a linear mode to derive predictionvalues of a chroma component from another component, and the DM modederives intra prediction mode of a chroma component from anothercomponent.

FIG. 24C shows a flowchart of an exemplary method for video processing.The method 2430 includes, at step 2432, determining, for a conversionbetween a current video block of a video and a coded representation ofthe video, parameters for a linear model prediction or cross-colorcomponent prediction based on refined neighboring luma samples andchroma samples of the current video block. The method 2430 includes, atstep 2434, deriving prediction values of a chroma component of thecurrent video block based on the parameters and refined internal lumasamples of the current video block. The method 2430 includes, at step2436, performing the conversion based on the prediction values.

FIG. 24D shows a flowchart of an exemplary method for video processing.The method 2440 includes, at step 2442, determining, for a conversionbetween a current video block of a video that is a chroma block and acoded representation of the video, parameters for a linear modelprediction or cross-color component prediction based on by selectingneighboring samples based on a position of a largest or a smallestneighboring sample. The method 2440 further includes, at step 2444,deriving prediction values of chroma samples of the current video blockbased on the parameters and internal luma samples of the current videoblock. The method 2440 further includes, at step 2446, performing theconversion based on the prediction values.

FIG. 24E shows a flowchart of an exemplary method for video processing.The method 2450 includes, at step 2452, determining, for a conversionbetween a current video block of a video and a coded representation ofthe video, parameters for a linear model prediction or cross-colorcomponent prediction based on a main color component and a dependentcolor component, the main color component selected as one of a lumacolor component and a chroma color component and the dependent colorcomponent selected as the other of the luma color component and thechroma color component. The method 2450 further includes, at step 2454,performing the conversion based on the determining.

FIG. 25A shows a flowchart of an exemplary method for video processing.The method 2510 includes, at step 2512, performing downsampling onchroma and luma samples of a neighboring block of the current videoblock. The method 2510 further includes, at step 2514, determining, fora conversion between a current video block of a video that is a chromablock and a coded representation of the video, parameters ofcross-component linear model (CCLM) based on the downsampled chroma andluma samples obtained from the downsampling. The method 2510 furtherincludes, at step 2516, applying the CCLM on luma samples located in aluma block corresponding to the current video block to derive predictionvalues of the current video block. The method 2015 further includes, atstep 2518, performing the conversion based on the prediction values.

FIG. 25B shows a flowchart of an exemplary method for video processing.The method 2520 includes, at step 2522, determining, for a conversionbetween a current video block of a video that is a chroma block and acoded representation of the video, parameters of a cross-componentlinear model (CCLM) based on two or more chroma samples from a group ofneighboring chroma samples, wherein the two or more chroma samples areselected based on a coding mode of the current video block. The method2520 further includes, at step 2524, applying the CCLM on luma sampleslocated in a luma block corresponding to the current video block toderive prediction values of the current video block. The method 2520further includes, at step 2526, performing the conversion based on theprediction values.

FIG. 26A shows a flowchart of an exemplary method for video processing.The method 2610 includes, at step 2612, determining, for a conversionbetween a current video block of a video that is a chroma block and acoded representation of the video, parameters of cross-component linearmodel (CCLM) based on chroma samples that are selected based on Wavailable above-neighboring samples, W being an integer. The method 2610further includes, at step 2614, performing the conversion based on thedetermining.

FIG. 26B shows a flowchart of an exemplary method for video processing.The method 2620 includes, at step 2622, determining, for a conversionbetween a current video block of a video that is a chroma block and acoded representation of the video, parameters of cross-component linearmodel (CCLM) based on chroma samples that are selected based on Havailable left-neighboring samples of the current video block. Themethod 2620 further includes, at step 2622, performing the conversionbased on the determining.

FIG. 27A shows a flowchart of an exemplary method for video processing.The method 2710 includes, at step 2712, determining, for a conversionbetween a current video block of a video that is a chroma block and acoded representation of the video, parameters of a cross-componentlinear model (CCLM) based on two or four chroma samples and/orcorresponding luma samples. The method 2710 further includes, at step2714, performing the conversion based on the determining.

FIG. 27B shows a flowchart of an exemplary method for video processing.The method 2720 includes, at step 2722, selecting, for a conversionbetween a current video block of a video that is a chroma block and acoded representation of the video, chroma samples based on a positionrule, the chroma samples used to derive parameters of a cross-componentlinear model (CCLM). The method 2720 further includes, at step 2724,performing the conversion based on the determining. In the example, theposition rule specifies to select the chroma samples that are locatedwithin an above row and/or a left column of the current video block.

FIG. 28A shows a flowchart of an exemplary method for video processing.The method 2810 includes, at step 2812, determining, for a conversionbetween a current video block of a video that is a chroma block and acoded representation of the video, positions at which luma samples aredownsampled, wherein the downsampled luma samples are used to determineparameters of a cross-component linear model (CCLM) based on chromasamples and downsampled luma samples, wherein the downsampled lumasamples are at positions corresponding to positions of the chromasamples that are used to derive the parameters of the CCLM. The method2810 further includes, at step 2814, performing the conversion based onthe determining.

FIG. 28B shows a flowchart of an exemplary method for video processing.The method 2820 includes, at step 2822, determining, for a conversionbetween a current video block of a video that is a chroma block and acoded representation of the video, a method to derive parameters of across-component linear model (CCLM) using chroma samples and lumasamples based on a coding condition associated with the current videoblock. The method 2820 further includes, at step 2824, performing theconversion based on the determining.

FIG. 28C shows a flowchart of an exemplary method for video processing.The method 2830 includes, at step 2832, determining, for a conversionbetween a current video block of a video that is a chroma block and acoded representation of the video, whether to derive maximum valuesand/or minimum values of a luma component and a chroma component thatare used to derive parameters of a cross-component linear model (CCLM)based on availability of a left-neighboring block and anabove-neighboring block of the current video block. The method 2830further includes, at step 2834, performing the conversion based on thedetermining.

FIG. 29A shows a flowchart of an exemplary method for video processing.The method 2910 includes, at step 2912, determining, for a conversionbetween a current video block of a video and a coded representation ofthe video, parameters of a coding tool using a linear model based onselected neighboring samples of the current video block andcorresponding neighboring samples of a reference block. The method 2910further includes, at step 2914, performing the conversion based on thedetermining.

FIG. 29B shows a flowchart of an exemplary method for video processing.The method 2920 includes, at step 2922, determining, for a conversionbetween a current video block of a video and a coded representation ofthe video, parameters of a local illumination compensation (LIC) toolbased on N neighboring samples of the current video block and Ncorresponding neighboring samples of a reference block, wherein the Nneighboring samples of the current video block are selected based onpositions of the N neighboring samples. The method 2920 furtherincludes, at step 2924, performing the conversion based on thedetermining. The LIC tool uses a linear model of illumination changes inthe current video block during the conversion.

FIG. 29C shows a flowchart of an exemplary method for video processing.The method 2930 includes, at step 2932, determining, for a conversionbetween a current video block of a video that is a chroma block and acoded representation of the video, parameters of a cross-componentlinear model (CCLM) based on chroma samples and corresponding lumasamples. The method 2930 further includes, at step 2934, performing theconversion based on the determining. In the example, some of the chromasamples are obtained by a padding operation and the chroma samples andthe corresponding luma samples are grouped into two arrays G0 and G1,each array including two chroma samples and corresponding luma samples.

4 Example Implementations of the Disclosed Technology

FIG. 30A is a block diagram of a video processing apparatus 3000. Theapparatus 3000 may be used to implement one or more of the methodsdescribed herein. The apparatus 3000 may be embodied in a smartphone,tablet, computer, Internet of Things (IoT) receiver, and so on. Theapparatus 3000 may include one or more processors 3002, one or morememories 3004 and video processing hardware 3006. The processor(s) 3002may be configured to implement one or more methods (including, but notlimited to, methods as shown FIGS. 18 to 29C) described in the presentdocument. The memory (memories) 3004 may be used for storing data andcode used for implementing the methods and techniques described herein.The video processing hardware 3006 may be used to implement, in hardwarecircuitry, some techniques described in the present document.

FIG. 30B is another example of a block diagram of a video processingsystem in which disclosed techniques may be implemented. FIG. 30B is ablock diagram showing an example video processing system 3100 in whichvarious techniques disclosed herein may be implemented. Variousimplementations may include some or all of the components of the system3100. The system 3100 may include input 3102 for receiving videocontent. The video content may be received in a raw or uncompressedformat, e.g., 8 or 10 bit multi-component pixel values, or may be in acompressed or encoded format. The input 3102 may represent a networkinterface, a peripheral bus interface, or a storage interface. Examplesof network interface include wired interfaces such as Ethernet, passiveoptical network (PON), etc. and wireless interfaces such as Wi-Fi orcellular interfaces.

The system 3100 may include a coding component 3104 that may implementthe various coding or encoding methods described in the presentdocument. The coding component 3104 may reduce the average bitrate ofvideo from the input 3102 to the output of the coding component 3104 toproduce a coded representation of the video. The coding techniques aretherefore sometimes called video compression or video transcodingtechniques. The output of the coding component 3104 may be eitherstored, or transmitted via a communication connected, as represented bythe component 3106. The stored or communicated bitstream (or coded)representation of the video received at the input 3102 may be used bythe component 3108 for generating pixel values or displayable video thatis sent to a display interface 3110. The process of generatinguser-viewable video from the bitstream representation is sometimescalled video decompression. Furthermore, while certain video processingoperations are referred to as “coding” operations or tools, it will beappreciated that the coding tools or operations are used at an encoderand corresponding decoding tools or operations that reverse the resultsof the coding will be performed by a decoder.

Examples of a peripheral bus interface or a display interface mayinclude universal serial bus (USB) or high definition multimediainterface (HDMI) or Displayport, and so on. Examples of storageinterfaces include SATA (serial advanced technology attachment), PCI,IDE interface, and the like. The techniques described in the presentdocument may be embodied in various electronic devices such as mobilephones, laptops, smartphones or other devices that are capable ofperforming digital data processing and/or video display.

In some embodiments, the video coding methods may be implemented usingan apparatus that is implemented on a hardware platform as describedwith respect to FIG. 30A or 30B.

Various techniques and embodiments may be described using the followingclause-based format.

The first set of clauses describe certain features and aspects of thedisclosed techniques listed in the previous section, including, forexample, Example 1.a-d and j.

1. A method of video processing, comprising: determining, for aconversion between a current video block of a video that is a chromablock and a coded representation of the video, parameters of across-component linear model based on two chroma samples from a group ofneighboring chroma samples, wherein the two chroma samples are selectedfrom the group based on a position rule; and performing the conversionbased on the determining.

2. The method of clause 1, wherein the parameters have values that aredetermined based on luma samples of the two chroma samples.

3. The method of clause 2, wherein the luma samples are downsampled usedto derive the parameters of the cross-component linear model.

4. The method of clause 1, wherein the parameters have values that aredetermined based on chroma samples at 2^(s) positions, S being aninteger.

5. The method of clause 1, wherein a top-left sample of the chroma blockis (x, y), wherein a width and a height of the chroma block is W and H,respectively, and wherein the group of neighboring chroma samplescomprises: sample A with coordinates (x−1, y), sample B with coordinates(x−1, y+H/2−1), sample C with coordinates (x−1, y+H/2), sample D withcoordinates (x−1, y+H−1), sample E with coordinates (x−1, y+H), sample Fwith coordinates (x−1, y+H+H/2−1), sample G with coordinates (x−1,y+H+H/2), sample I with coordinates (x−1, y+H+H−1), sample J withcoordinates (x, y−1), sample K with coordinates (x+W/2−1, y−1), sample Lwith coordinates (x+W/2, y−1), sample M with coordinates (x+W−1, y−1),sample N with coordinates (x+W, y−1), sample 0 with coordinates(x+W+W/2−1, y−1), sample P with coordinates (x+W+W/2, y−1), and sample Qwith coordinates (x+W+W−1, y−1).

6. The method of clause 5, wherein the position rule specifies that thetwo chroma samples are selected from the samples A, D, J and M.

7. The method of clause 5, wherein the position rule specifies that thetwo chroma samples are selected from the samples A, B, C, D, J, K, L andM.

8. The method of clause 5, wherein the position rule specifies that thetwo chroma samples are selected from the samples A, I, J and Q.

9. The method of clause 5, wherein the position rule specifies that thetwo chroma samples are selected from the samples A, B, D, I, J, K, M andQ.

10. The method of clause 5, wherein the position rule specifies that thetwo chroma samples are selected from the samples A, B, D, F, J, K, M andO.

11. The method of clause 5, wherein the position rule specifies that thetwo chroma samples are selected from the samples A, C, G, I, J, L, P andQ.

12. The method of clause 5, wherein the position rule specifies that thetwo chroma samples are selected from the samples A, C, E, G, J, L, N andP.

13. The method of clause 5, wherein the position rule specifies that thetwo chroma samples are selected from the samples J, K, L and M.

14. The method of clause 5, wherein the position rule specifies that thetwo chroma samples are selected from the samples J, L, N and Q.

15. The method of clause 5, wherein the position rule specifies that thetwo chroma samples are selected from the samples J, K, L, M, N, O, P andQ.

16. The method of clause 5, wherein the position rule specifies that thetwo chroma samples are selected from the samples A, B, C, D, E, F, G,and I.

17. The method of clause 5, wherein the position rule specifies that thetwo chroma samples are selected from the samples J, K, L, M, N, O, P,and Q.

18. The method of clause 5, wherein the position rule specifies that oneof the two chroma samples are selected from the samples A, B, C, D, E,F, G, and I and the other of the two chroma samples are selected fromthe samples J, K, L, M, N, O, P, and Q.

19. The method of any of clauses 5-18, wherein the two chroma sampleshave identical corresponding luma values, the method further includeschecking an additional chroma sample.

20. The method of clause 1, wherein chroma samples in the group ofneighboring chroma samples are searched to find the two chroma sampleswith minimum and maximum corresponding luma values to determine a firstset of values for the parameters.

21. The method of clause 1, wherein an above neighboring sample withcoordinates (x, y) is in the group only if x % K=0, K being 2, 4, 6 or 8and % being a modulo operator.

22. The method of clause 1, wherein a left neighboring sample withcoordinates (x, y) is in the group only if y % K=0, K being 2, 4, 6 or 8and % being a modulo operator.

23. The method of clause 1, wherein the two chroma samples are selectedbased on availabilities of neighboring blocks.

24. The method of any of clauses 1-23, wherein the performing of theconversion includes generating the coded representation from the currentblock.

25. The method of any of clauses 1-23, wherein the performing of theconversion includes generating the current block from the codedrepresentation.

26. An apparatus in a video system comprising a processor and anon-transitory memory with instructions thereon, wherein theinstructions upon execution by the processor, cause the processor toimplement the method in any one of clauses 1 to 25.

27. A computer program product stored on a non-transitory computerreadable media, the computer program product including program code forcarrying out the method in any one of clauses 1 to 25.

The second set of clauses describe certain features and aspects of thedisclosed techniques listed in the previous section, including, forexample, Example 1.e-i and Example 9.

1. A method for video processing, comprising: determining, for aconversion between a current video block of a video that is a chromablock and a coded representation of the video, parameters of across-component linear model based on selected chroma samples based onpositions of the chroma samples, wherein the selected chroma samples areselected from a group of neighboring chroma samples; and performing theconversion based on the determining.

2. The method of clause 1, wherein at least one neighboring chromasample does not belong to the selected chroma samples.

3. The method of clause 1, wherein all of the selected chromaneighboring samples are left to the current block in a case that aprediction mode of the current video block is a first linear mode thatuses left-neighboring samples only.

4. The method of clause 1, wherein all of the selected chromaneighboring samples are above to the current block in a case that aprediction mode of the current video block is a second linear usesabove-neighboring samples only.

5. The method of any of clauses 1-4, wherein positions of the chromasamples are selected based on the width or the height of the chromablock.

6. The method of clauses 1, wherein the positions of the chroma samplescorrespond to a signaling in a video parameter set (VPS), a sequenceparameter set (SPS), a picture parameter set (PPS), a slice header, atile group header, a tile, a coding unit (CU), a coding tree unit (CTU)or a prediction unit (PU).

7. The method of clause 1, wherein determining of the parameters isfurther based on a least mean squares method.

8. The method of clause 1, wherein the determining of the parameters isfurther based on a two-point method.

9. A method for video processing, comprising: determining, for a currentvideo block, a group of neighboring chroma samples used to derive a setof values for parameters of a linear model, wherein a width and a heightof the current video block is W and H, respectively, and wherein thegroup of neighboring chroma samples comprises at least one sample thatis located beyond 2×W above neighboring chroma samples or 2×H leftneighboring chroma samples; and performing, based on the linear model, aconversion between the current video block and a coded representation ofa video including the current video block.

10. The method of clause 8, wherein the current video block is codedusing a linear intra prediction mode, wherein a top-left sample of thecurrent video block is (x, y), wherein the at least one sample is (x/,y+d), wherein d is an integer in a range [T, 0.5], and wherein T and Sare integers.

11. The method of clause 9, wherein T<0 and S>(2×H/).

12. The method of clause 9, wherein T=4 and S=3×H.

13. The method of clause 9, wherein T=0 and S=max(2×W, W+H).

14. The method of clause 9, wherein T=0 and S=4×H.

15. The method of clause 8, wherein the current video block is codedusing a linear intra prediction mode, wherein a top-left sample of thecurrent video block is (x, y), wherein the at least one sample is (x+d,y−1), wherein d is an integer in a range [T, S], and wherein T and S areintegers.

16. The method of clause 15, wherein T<0 and S>(2×W−1).

17. The method of clause 15, wherein T=4 and S=3×W.

18. The method of clause 15, wherein T=0 and S=max(2×W, W+H).

19. The method of clause 15, wherein T=0 and S=4×W.

20. The method of any of clauses 1-19, wherein the performing of theconversion includes generating the coded representation from the currentblock.

21. The method of any of clauses 1-19, wherein the performing of theconversion includes generating the current block from the codedrepresentation.

22. An apparatus in a video system comprising a processor and anon-transitory memory with instructions thereon, wherein theinstructions upon execution by the processor, cause the processor toimplement the method in any one of clauses 1 to 21.

23. A computer program product stored on a non-transitory computerreadable media, the computer program product including program code forcarrying out the method in any one of clauses 1 to 21.

The third set of clauses describe certain features and aspects of thedisclosed techniques listed in the previous section, including, forexample, Example 2 and Example 5.

1. A method for video processing, comprising: determining, for aconversion between a current video block of a video that is a chromablock and a coded representation of the video, multiple sets ofparameters, wherein each set of parameters defines a cross-componentlinear model (CCLM) and is derived from a corresponding group of chromasamples at corresponding chroma sample positions; determining, based onthe multiple sets of parameters, parameters for a final CCLM; andperforming the conversion based on the final CCLM.

2. The method of clause 1, wherein the parameters for the final CCLM aredetermined as an average of corresponding parameters in the multiplesets of parameters.

3. The method of clause 1, wherein the multiple sets of parametersinclude a first set of (α1, β1) and a second set of (α2, β2) and achroma prediction is calculated based on parameters of α1, β1, α2, β2.

4. The method of clause 1, wherein the multiple sets of parameters areshifted and combined to form the final CCLM.

5. The method of clause 1, wherein the multiple sets of parametersinclude a first set of (α1, β1) that is derived from a first group ofchroma samples and a second set of (α2, β2) that is derived from asecond group of chroma samples, the first group and the second groupcorresponding to different chroma sample positions from each other.

6. The method of clause 5, wherein a top-left sample of the chroma blockis (x, y) and a width and a height of the chroma block is W and H,respectively, and wherein the group of chroma samples comprises at leastone of:

sample A with coordinates (x−1, y),

sample B with coordinates (x−1, y+H/2−1),

sample C with coordinates (x−1, y+H/2),

sample D with coordinates (x−1, y+H−1),

sample E with coordinates (x−1, y+H),

sample F with coordinates (x−1, y+H+H/2−1),

sample G with coordinates (x−1, y+H+H/2),

sample I with coordinates (x−1, y+H+H−1),

sample J with coordinates (x, y−1),

sample K with coordinates (x+W/2−1, y−1),

sample L with coordinates (x+W/2, y−1),

sample M with coordinates (x+W−1, y−1),

sample N with coordinates (x+W, y−1),

sample O with coordinates (x+W+W/2−1, y<1),

sample P with coordinates (x+W+W/2, y−1), or

sample Q with coordinates (x+W+W−1, y−1).

7. The method of clause 6, wherein the first group includes Samples Aand D and the second group includes Samples J and M or Samples E and I.

8. The method of clause 6, wherein the first group includes Samples Aand I and the second group includes Samples J and Q.

9. The method of clause 6, wherein the first group includes Samples Aand B and the second group includes Samples C and D.

10. The method of clause 6, wherein the first group includes J and M andthe second group includes N and Q.

11. The method of clause 6, wherein the first group includes J and K andthe second group includes L and M.

12. A method of video processing, comprising: determining, for aconversion between a current video block of a video and a codedrepresentation of the video, parameters of a cross-component linearmodel (CCLM) based on maximum and minimum values of chroma and lumasamples of N groups of chroma and luma samples selected from neighboringluma and chroma samples of the current video block; and performing theconversion using the CCLM.

13. The method of clause 12, wherein the N groups of chroma and lumasamples comprise S₀, S₁, . . . , S_(m) and wherein 1≤m≤N−1, wherein inand N are non-negative integers, wherein a maximum luma value iscalculated as maxL=f1(maxL_(S0), maxL_(S1), . . . , maxL_(Sm)), whereinf1 is a first function and maxL_(Si) is a maximum luma value of a groupS_(i) of the plurality of groups, wherein a maximum chroma value iscalculated as maxC=f2(maxC_(S0), maxC_(S1), . . . , maxC_(Sm)), whereinf2 is a second function and maxC_(Si) is a chroma value of the groupS_(i) corresponding to maxL_(Si), wherein a minimum luma value iscalculated as minL=f3(minL_(S0), minL_(S1), . . . , minL_(Sm)), whereinf3 is a third function and minL_(Si) is a minimum luma value of thegroup S_(i), wherein a minimum chroma value is calculated asminC=f4(minC_(S0), minC_(S1), . . . , minC_(Sm)), wherein f4 is a fourthfunction and minC_(Si) is a chroma value of the group S_(i),corresponding to minL_(Si) and wherein the parameters of the linearmodel comprise α and β that are calculated as α=(maxC−minC)/(maxL−minL)and β=minC−α×minL.

14. The method of clause 13, wherein f1, f2, f3 and f4 are averagingfunctions.

15. The method of clause 13 or 14, wherein m=N−1.

16. The method of clause 13 or 14, wherein m=1, and wherein S₁=S_(N-1).

17. The method of clause 13 or 14, wherein m=0.

18. The method of clause 13 or 14, wherein S₀ comprises samples from anabove row of the current video block, and wherein S1 comprises samplesfrom a left row of the current video block.

19. The method of clause 13 or 14, wherein samples from an above row ofthe current video block have coordinates (x, y), wherein S₀ comprises afirst portion of the samples, wherein each sample of the first portionsatisfies x % P=Q, wherein S₁ comprises a second portion of the samples,wherein each sample of the second portion satisfies x % P≠Q, and wherein% is a modulo operator and P and Q are non-negative integers.

20. The method of clause 13 or 14, wherein samples from a left row ofthe current video block have coordinates (x, y), wherein S₀ comprises afirst portion of the samples, wherein each sample of the first portionsatisfies y % P=Q, wherein S₁ comprises a second portion of the samples,wherein each sample of the second portion satisfies y % P≠Q, and wherein% is a modulo operator and P and Q are non-negative integers.

21. The method of clause 19 or 20, wherein P=2 and Q=1, or P=2 and Q=0,or P=4 and Q=O.

22. The method of any of clauses 12 to 14, wherein the chroma and lumasamples comprise only a portion of the chroma and luma samples of theneighboring block.

23. The method of any of clauses 13 to 22, wherein N is predetermined.

24. The method of any of clauses 13 to 23, wherein N is signaled in asequence parameter set (SPS), a video parameter set (VPS), a pictureparameter set (PPS), a picture header, a slice header, a tile groupheader, one or more largest coding units or one or more coding units.

25. The method of clause 12, wherein the chroma and luma samples foreach group are selected based on an availability of the neighboringblock of the current video block.

26. The method of clause 12, wherein the chroma and luma samples foreach group are selected based on a width and a height of the currentvideo block.

27. The method of clause 12, wherein the chroma and luma samples foreach group are selected based on values of the chroma and luma samples.

28. The method of any of clauses 1-27, wherein the performing of theconversion includes generating the coded representation from the currentblock.

29. The method of any of clauses 1-27, wherein the performing of theconversion includes generating the current block from the codedrepresentation.

30. An apparatus in a video system comprising a processor and anon-transitory memory with instructions thereon, wherein theinstructions upon execution by the processor, cause the processor toimplement the method in any one of clauses 1 to 29.

31. A computer program product stored on a non-transitory computerreadable media, the computer program product including program code forcarrying out the method in any one of clauses 1 to 29.

The fourth set of clauses describe certain features and aspects of thedisclosed techniques listed in the previous section, including, forexample, Example 3.a-b and 3.d.

1. A method of video processing, comprising: determining, for aconversion between a current video block of a video that is a chromablock and a coded representation of the video, parameters of across-component linear model that are completely determinable by twochroma samples and corresponding two luma samples; and performing theconversion based on the determining.

2. The method of clause 1, wherein the two chroma samples are denoted asC0 and C1, the corresponding luma samples are denoted as L0 and L1, theparameters of the cross-component linear model are denoted α and β, andα and β are defined by equations: α=(C1−C0)/(L1−L0) and β=C0−α×L0.

3. The method of clause 2, wherein if L1 is equal to L0, then α=0.

4. The method of clause 2, wherein if L1 is equal to L0, other intraprediction mode than the cross-component linear model mode is used.

5. The method of clause 2, wherein a is determined by excluding adivision operation.

6. The method of clause 2, wherein a is determined using an operationwithout a look up table, the operation excluding a division operation.

7. The method of clause 2, wherein the parameters of the cross-componentlinear model have values that are determined based on a value of(L1−L0).

8. The method of clause 2, wherein α=Shift(C1−C0, Floor(log₂(L1−L0))),wherein Shift(x, s)=(x+off)>>s and off is an integer, wherein Floor(x)is a floor function that outputs an integer portion of x.

9. The method of clause 2, wherein α=Shift(C1−C0, Ceiling(log₂(L1−L0))),wherein Shift(x, s)=(x+off)>>s and off is an integer, wherein Ceiling(x)is a ceiling function that outputs the least integer greater than orequal to x.

10. The method of clause 8 or 9, wherein an operation for obtaining avalue of log 2(x) is performed by checking a position of a mostsignificant digit of x.

11. The method of clause 1, wherein the determining of the parameters isperformed within K bits, K being 8, 10, 12, 16, 24 or 32.

12. The method of clause 11, wherein an intermediate variable is clippedor right shifted to be within the K bits.

13. The method of any of clauses 1-12, wherein the performing of theconversion includes generating the coded representation from the currentblock.

14. The method of any of clauses 1-12, wherein the performing of theconversion includes generating the current block from the codedrepresentation.

15. An apparatus in a video system comprising a processor and anon-transitory memory with instructions thereon, wherein theinstructions upon execution by the processor, cause the processor toimplement the method in any one of clauses 1 to 14.

16. A computer program product stored on a non-transitory computerreadable media, the computer program product including program code forcarrying out the method in any one of clauses 1 to 14.

The fifth set of clauses describe certain features and aspects of thedisclosed techniques listed in the previous section, including, forexample, Example 3.c.

1. A method of video processing, comprising: determining, for aconversion between a current video block of a video that is a chromablock and a coded representation of the video, parameters of across-component linear model using a parameter table whose entries areretrieved according to two chroma sample values and two luma samplevalues; and performing the conversion based on the determining.

2. The method of clause 1, wherein the parameter table has a size of Vthat is less than 2^(P), P being an integer.

3. The method of clause 1, wherein the parameter table has entries, eachentry storing an F-bit integer number and F being 8 or 16.

4. The method of clause 1, wherein the parameter table M[k] satisfiesM[k−Z]=((1<<S)+Off)/k, S being an integer defining a precision, Offindicating an offset, Z being a first value of the parameter table.

5. The method of clause 1, wherein the two chroma samples are denoted asC0 and C1, the luma samples are denoted as L0 and L1, the parameters ofthe cross-component linear model are denoted α and β, and α and β aredefined by equations: α=(C1−C0)/(L1−L0) and β=C0−α×L0.

6. The method of clause 5, wherein k=Shift(L1−L0, W) and k is used toinquire an entry in the parameter table, and wherein Shift(x,s)=(x+off)>>s, off is an integer, and W is an width of the current videoblock.

7. The method of clause 6, wherein α is zero when k−Z<0 or k−Z≥V, Vindicating a size of the parameter table and Z indicating a first valueof the parameter table.

8. The method of clause 5, wherein α=Shift ((C1−C0)×M[k−Z], D) orα=SignShift((C1−C0)×M[k−Z], D), and wherein Shift(x, s)=(x+off)>>s andSignShift (x, s)=(x+off)>>s, if x>0, or −(−x+off)>>s, if x<0, off is aninteger, and k indicating an index to inquire an entry in the parametertable. 9. The method of clause 8, wherein k is derived based on a valueof (L1−L0) and not based on a value of (C1-00).

10. The method of clause 8, wherein k is derived based on both values of(L1−L0) and (C1-C0).

11. The method of clause 6, wherein k is valid within a range betweenkMin and kMax.

12. The method of clause 8, wherein k=Shift(L1−L0, W) and k is an indexto inquire an entry in the parameter table, and wherein Shift(x,s)=(x+off)>>s, off is an integer, and W is an width of the current videoblock.

13. The method of clause 8, wherein k is valid within a range betweenkMin and kMax, and k=L1−L0, if (L1−L0)≤kMax and k=Shift (L1−L0, W) if(L1=L0)>kMax.

14. The method of clause 8, wherein k is valid within a range betweenkMin and kMax, and k=Min (kMax, L1−L0) or k=Max (kMin, Min (kMax,L1−L0)).

15. The method of clause 5, wherein (L1−L0)<0 and the determining isperformed to derive a value of ‘−α’ instead of α.

16. The method of clause 5, wherein (L1−L0)=0 and a is set to a defaultvalue that is 0 or 1.

17. The method of clause 5, wherein (L1−L0)=2^(E), E≥0, α=Shift((C1−C0), E) or Singshift ((C1−C0), E), and wherein Shift(x,s)=(x+off)>>s and SignShift (x, s)=(x+off)>>s, if x≥0, or −(−x+off)>>s,if x<0.

18. The method of any of clauses 1-17, wherein the performing of theconversion includes generating the coded representation from the currentblock.

19. The method of any of clauses 1-17, wherein the performing of theconversion includes generating the current block from the codedrepresentation.

20. An apparatus in a video system comprising a processor and anon-transitory memory with instructions thereon, wherein theinstructions upon execution by the processor, cause the processor toimplement the method in any one of clauses 1 to 19.

21. A computer program product stored on a non-transitory computerreadable media, the computer program product including program code forcarrying out the method in any one of clauses 1 to 19.

The sixth set of clauses describe certain features and aspects of thedisclosed techniques listed in the previous section, including, forexample, Example 4 and Example 6.

1. A method of video processing, comprising: determining, for aconversion between a current video block of a video that is a chromablock and a coded representation of the video, a final prediction P(x,y) of a chroma sample at a position (x, y) in the current video block asa combination of prediction results of multiple cross-component linearmodels (MCCLMs), wherein the MCCLMs are selected based on the position(x, y) of the chroma sample; and performing the conversion based on thefinal prediction.

2. The method of clause 1, wherein the multiple cross-component linearmodels include a first linear model whose parameters are derived onlyfrom left-neighboring samples and a second linear model whose parametersare derived only from above-neighboring samples.

3. The method of clause 1, wherein some of the chroma samples arepredicted based on left-neighboring samples only and some of the chromasamples are predicted based on above-neighboring samples only.

4. The method of clause 2 or 3, wherein the final prediction P (x, y) ofthe chroma sample is based on a weighted average of a prediction P1 (x,y) by the first linear model and a prediction P2(x, y) by the secondlinear model.

5. The method of clause 4, wherein P (x, y)=w1×P1(x, y)+w2×P2(x, y),wherein w1 and w2 are weights constrained by w1+w2=1.

6. The method of clause 4, wherein P (x, y)=(w1*P1(x, y)+w2*P2(x,y)+Offset)>>shift, where offset is an integer including 0 or1<<(shift−1), shift is an integer, and w1 and w2 are weights constrainedby w1+w2=1<<shift.

7. The method of clause 4, wherein P (x, y)=(w1*P1(x,y)+((1<<shift)−w1)*P2(x, y)+Offset)>>shift, where offset is an integerincluding 0 or 1<<(shift−1), shift is an integer, and w1 and w2 areweights.

8. The method of any of clauses 5-7, wherein values of w1 and w2 dependon the position (x, y).

9. The method of any of clauses 5-7, wherein if x>y, then w1<w2, whereinif x<y, then w1>w2, and wherein if x=y, then w1=w2.

10. The method of any of clauses 5-7, wherein, for a case of x<y, avalue of (w1−w2) increases if a value of (y−x) increases.

11. The method of any of clauses 5-7, wherein, for a case of x>y, avalue of (w2−w1) increases if a value of (x−y) increases.

12. A method of video processing, comprising: performing, for aconversion between a current video block of a video that is a chromablock and a coded representation of the video, a first determinationregarding whether a first cross-component linear model (CCLM) that usesonly left-neighboring samples is used for predicting samples of thecurrent video block and/or a second determination regarding whether asecond cross-component linear model (CCLM) that uses onlyabove-neighboring samples is used for predicting samples of the currentvideo block; and performing the conversion based on the firstdetermination and/or the second determination.

13. The method of clause 12, wherein the first CCLM is not applied for acase that satisfies W>K×H, K being a non-negative integer.

14. The method of clause 12, wherein the second CCLM is not applied fora case that satisfies H>K×W, K being a non-negative integer.

15. The method of clause 12, wherein a flag indicating the applicationof the first CCLM or the second CCLM is not signaled for a case that oneof the first CCLM and the second CCLM is not applied.

16. The method of any of clauses 1-15, wherein the performing of theconversion includes generating the coded representation from the currentblock.

17. The method of any of clauses 1-15, wherein the performing of theconversion includes generating the current block from the codedrepresentation.

18. An apparatus in a video system comprising a processor and anon-transitory memory with instructions thereon, wherein theinstructions upon execution by the processor, cause the processor toimplement the method in any one of clauses 1 to 17.

19. A computer program product stored on a non-transitory computerreadable media, the computer program product including program code forcarrying out the method in any one of clauses 1 to 17.

The seventh set of clauses describe certain features and aspects of thedisclosed techniques listed in the previous section, including, forexample, Examples 7, 8, 11-13.

1. A method for video processing, comprising: determining, for aconversion between a current video block of a video and a codedrepresentation of the video, a context that is used to code a flag usingarithmetic coding in the coded representation of the current videoblock, wherein the context is based on whether a top-left neighboringblock of the current video block is coded using a cross-component linearmodel (CCLM) prediction mode; and performing the conversion based on thedetermining, wherein the flag is signaled to indicate whether the CCLMprediction mode is applied on the current video block, and wherein theCCLM prediction mode uses a linear mode to derive prediction values of achroma component from another component.

2. The method of clause 1, wherein the context comprise a first contextof the top-left neighboring block uses the CCLM prediction mode andcomprises a second context different from the first context if thetop-left neighboring block does not use the CCLM prediction mode.

3. The method of clause 1, wherein the top-left neighboring block isunavailable, and wherein the CCLM prediction mode is considered to beenabled.

4. The method of clause 1, wherein the top-left neighboring block isunavailable, and wherein the CCLM prediction mode is considered to bedisabled.

5. The method of clause 1, wherein the top-left neighboring block isintra-coded, and wherein the CCLM prediction mode is considered to beenabled.

6. The method of clause 1, wherein the top-left neighboring block isintra-coded, and wherein the CCLM prediction mode is considered to bedisabled.

7. A method of video processing, comprising: determining, for aconversion between a current video block of a video and a codedrepresentation of the video, a coding order for one or more indicationsof a derived mode (DM mode) and a linear mode (LM mode) based on acoding mode of one or more neighboring blocks of the current videoblock; and performing the conversion based on the determining, whereinthe LM mode uses a linear mode to derive prediction values of a chromacomponent from another component, and the DM mode derives intraprediction mode of a chroma component from another component.

8. The method of clause 7, wherein a top-left neighboring block of theone or more neighboring blocks is coded with the LM mode, and wherein anindication of the LM mode is coded first.

9. The method of clause 7, wherein a top-left neighboring block of theone or more neighboring blocks is coded with the DM mode, and wherein anindication of the DM mode is coded first.

10. The method of clause 7, wherein a top-left neighboring block of theone or more neighboring blocks is coded with a coding mode that isdifferent from the LM mode, and wherein an indication of the DM mode iscoded first.

11. The method of any of clauses 7 to 10, wherein the one or moreindications are signaled in a sequence parameter set (SPS), a videoparameter set (VPS), a picture parameter set

(PPS), a picture header, a slice header, a tile group header, one ormore largest coding units or one or more coding units.

12. A method of video processing, comprising: determining, for aconversion between a current video block of a video and a codedrepresentation of the video, parameters for a linear model prediction orcross-color component prediction based on refined neighboring lumasamples and chroma samples of the current video block; derivingprediction values of a chroma component of the current video block basedon the parameters and refined internal luma samples of the current videoblock; and performing the conversion based on the prediction values.

13. The method of clause 12, wherein neighboring luma samples andinternal luma samples are downsampled before a refinement process.

14. The method of clause 12, wherein a refinement process comprises afiltering process or a non-linear process.

15. The method of clause 12, wherein the parameters for the linear modelprediction are α and β, wherein α=(C1−C0)/(L1−L0) and β=C0−αL0, whereinC0 and C1 are derived from neighboring chroma samples, and wherein L0and L1 are derived from neighboring luma samples.

16. The method of clause 15, wherein C0 and L0 are based on Sneighboring chroma and luma samples, denoted {Cx1, Cx2, . . . , CxS} and{Lx1, Lx2, . . . , LxS}, respectively, wherein C1 and L1 are based on Tneighboring chroma and luma samples, denoted {Cy1, Cy2, . . . , CyT} and{Ly1, Ly2, . . . , LyT}, respectively, wherein {Cx1, Cx2, . . . , CxS}are corresponding to {Lx1, Lx2, . . . , LxS}, wherein {Cy1, Cy2, . . . ,CyT} are corresponding to {Ly1, Ly2, . . . , LyT}, wherein C0=f0(Cx1,Cx2, . . . , CxS), L0=f1(Lx1, Lx2, . . . , LxS), C1=f2(Cy1, Cy2, . . . ,CyT) and L1=f1(Ly1, Ly2, . . . , LyT), and wherein f0, f1, f2 and f3 arefunctions.

17. The method of clause 16, wherein f0 and f1 are a first function.

18. The method of clause 16, wherein f2 and f3 are a second function.

19. The method of clause 17, wherein f0, f1, f2 and f3 are a thirdfunction.

20. The method of clause 19, wherein the third function is an averagingfunction.

21. The method of clause 16, wherein S=T.

22. The method of clause 16, wherein {Lx1, Lx2, . . . , LxS} are thesmallest samples of a group of luma samples.

23. The method of clause 16, wherein {Ly1, Ly2, . . . , LyT} are thelargest samples of a group of luma samples.

24. The method of clause 22 or 23, wherein the group of luma samplescomprises all neighboring samples used in VTM-3.0 to derive theparameters of the linear model prediction.

25. The method of clause 22 or 23, wherein the group of luma samplescomprises a subset of neighboring samples used in VTM-3.0 to derive theparameters of the linear model prediction, and wherein the subset is notidentical to all the neighboring samples.

26. A method of video processing, comprising: determining, for aconversion between a current video block of a video that is a chromablock and a coded representation of the video, parameters for a linearmodel prediction or cross-color component prediction based on byselecting neighboring samples based on a position of a largest or asmallest neighboring sample; deriving prediction values of chromasamples of the current video block based on the parameters and internalluma samples of the current video block; and performing the conversionbased on the prediction values.

27. The method of clause 26, wherein the largest neighboring sample islocated at a position (x0, y0), samples in a region (x0−d1, y0), (x0,y0−d2), (x0+d3, y0), (x0, y0+d4) are utilized to select the neighboringsamples, and wherein {d1, d2, d3, d4} depend on the position (x0, y0).

28. The method of clause 26, wherein the smallest neighboring sample islocated at a position (x1, y1), samples in a region (x1−d1, y1), (x1,y1−d2), (x1+d3, y1), (x1, y1+d4) are utilized to select the neighboringsamples, and wherein {d1, d2, d3, d4} depend on the position (x1, y1).

29. The method of any of clauses 26-28, wherein the neighboring samplesrepresent a color component.

30. A method of video processing, comprising: determining, for aconversion between a current video block of a video and a codedrepresentation of the video, parameters for a linear model prediction orcross-color component prediction based on a main color component and adependent color component, the main color component selected as one of aluma color component and a chroma color component and the dependentcolor component selected as the other of the luma color component andthe chroma color component; and performing the conversion based on thedetermining.

31. The method of any of clauses 1-30, wherein the performing of theconversion includes generating the coded representation from the currentblock.

32. The method of any of clauses 1-30, wherein the performing of theconversion includes generating the current block from the codedrepresentation.

33. An apparatus in a video system comprising a processor and anon-transitory memory with instructions thereon, wherein theinstructions upon execution by the processor, cause the processor toimplement the method in any one of clauses 1 to 32.

34. A computer program product stored on a non-transitory computerreadable media, the computer program product including program code forcarrying out the method in any one of clauses 1 to 32.

The eight set of clauses describe certain features and aspects of thedisclosed techniques listed in the previous section, including, forexample, Examples 10 and 14.

1. A method for video processing, comprising: performing downsampling onchroma and luma samples of a neighboring block of the current videoblock; determining, for a conversion between a current video block of avideo that is a chroma block and a coded representation of the video,parameters of cross-component linear model (CCLM) based on thedownsampled chroma and luma samples obtained from the downsampling;applying the CCLM on luma samples located in a luma block correspondingto the current video block to derive prediction values of the currentvideo block; and performing the conversion based on the predictionvalues.

2. The method of clause 1, wherein the current video block has a height(H) and a width (W) and the downsampling is based on the height or thewidth.

3. The method of clause 1, wherein the downsampled chroma and lumasamples are obtained before deriving the parameters of the CCLMincluding α and β, and wherein α and β are defined by equations:α=(C1−C0)/(L1−L0) and β=C0−α×L0.

4. The method of clause 1, wherein the number of left-neighboringsamples used to derive the parameters of CCLM is same as the number ofabove-neighboring samples used to derive the parameters of CCLM.

5. The method of clause 2, wherein W<H or W>H.

6. The method of clause 2, wherein whether to downsample the chroma andluma samples of a left-neighboring block or an above-neighboring blockdepends on a relative size of W and H.

7. The method of clause 6, wherein the downsampling is performed on thechroma and luma samples of a left-neighboring block in a case of H>W.

8. The method of clause 6, wherein the downsampling is performed on thechroma and luma samples of an above-neighboring block in a case of W>H.

9. The method of clause 7, wherein a top-left sample of the currentvideo block is R[0, 0], wherein the downsampled chroma samples comprisesamples R[−1, K×H/W], and wherein K is a non-negative integer rangingfrom 0 to W−1.

10. The method of clause 8, wherein a top-left sample of the currentvideo block is R[0, 0], wherein the downsampled chroma samples comprisesamples R[K×H/W, 1], and wherein K is a non-negative integer rangingfrom 0 to H−1.

11. A method of video processing, comprising: determining, for aconversion between a current video block of a video that is a chromablock and a coded representation of the video, parameters of across-component linear model (CCLM) based on two or more chroma samplesfrom a group of neighboring chroma samples, wherein the two or morechroma samples are selected based on a coding mode of the current videoblock; applying the CCLM on luma samples located in a luma blockcorresponding to the current video block to derive prediction values ofthe current video block; and performing the conversion based on theprediction values.

12. The method of clause 11, wherein two or more luma samplescorresponding to the two or more chroma samples are used to derive theparameters of the cross-component linear model.

13. The method of clause 12, wherein the two or more luma samples aredownsampled to derive the parameters of the cross-component linearmodel.

14. The method of clause 11, wherein the two or more chroma samples areselected based on availabilities of neighboring samples.

15. The method of clause 11, wherein the two or more chroma samples areselected from one or more of a left column, an above row, an above-rightrow or a below-left column relative to the current video block.

16. The method of clause 11, wherein the two or more chroma samples areselected based on a ratio of a height of the current video block to awidth of the current video block.

17. The method of clause 11, wherein the two or more chroma samples areselected based on whether a width or a height of the current video blockis equal to K, K being an integer.

18. The method of clause 17, wherein K=2.

19. The method of clause 11, wherein the coding mode of the currentvideo block is one of a first linear mode that uses two samples fromleft-neighboring samples and two samples from above-neighboring samples,a second linear mode that uses only left-neighboring samples, and athird linear mode that uses only above-neighboring samples, whereincoordinates of a top-left sample of the current video block are (x, y),and wherein a width and a height of the current video block is W and H,respectively.

20. The method of clause 19, wherein the two or more chroma samplescomprise samples with coordinates (x−1, y), (x, y−1), (x−1, y+H−1) and(x+W−1, y−1) in the first linear mode.

21. The method of clause 19, wherein the two or more chroma samplescomprise samples with coordinates (x−1, y), (x, y−1), (x−1, y+H−H/W−1)and (x+W−1, y−1) in the first linear mode, and wherein H>W.

22. The method of clause 19, wherein the two or more chroma samplescomprise samples with coordinates (x−1, y), (x, y−1), (x−1, y+H−1) and(x+W−W/H−1, y−1) in the first linear mode, and wherein H<W.

23. The method of clause 19, wherein the two or more chroma samplescomprise samples with coordinates (x−1, y), (x, y−1), (x−1, y+H max(1,H/W)) and (x+W−max(1, W/H), y−1) in the first linear mode.

24. The method of clause 19, wherein the two or more chroma samplescomprise samples with coordinates (x, y−1), (x+W/4, y−1), (x+2*W/4, y−1)and (x+3*W/4, y−1) in the third linear mode.

25. The method of clause 19, wherein the two or more chroma samplescomprise samples with coordinates (x, y−1), (x+W/4, y−1), (x+3*W/4, y−1)and (x+W−1, y−1) in the third linear mode.

26. The method of clause 19, wherein the two or more chroma samplescomprise samples with coordinates (x, y−1), (x+(2 W)/4, y−1), (x+2*(2W)/4, y−1) and (x+3*(2 W)/4, y−1) in the third linear mode.

27. The method of clause 19, wherein the two or more chroma samplescomprise samples with coordinates (x, y−1), (x+(2 W)/4, y−1), (x+3*(2W)/4, y−1) and (x+(2 W)−1, y−1) in the third linear mode.

28. The method of clause 19, wherein the two or more chroma samplescomprise samples with coordinates (x−1, y), (x−1, y+H/4), (x−1, y+2*H/4)and (x−1, y+3*H/4) in the second linear mode.

29. The method of clause 19, wherein the two or more chroma samplescomprise samples with coordinates (x−1, y), (x−1, y+2*H/4), (x−1,y+3*H/4) and (x−1, y+H−1) in the second linear mode.

30. The method of clause 19, wherein the two or more chroma samplescomprise samples with coordinates (x−1, y), (x−1, y+(2H)/4), (x−1,y+2*(2H)/4) and (x−1, y+3*(2H)/4) in the second linear mode.

31. The method of clause 19, wherein the two or more chroma samplescomprise samples with coordinates (x−1, y), (x−1, y+2*(2H)/4), (x−1,y+3*(2H)/4) and (x−1, y+(2H)−1) in the second linear mode.

32. The method of any of clauses 20 to 31, wherein exactly two samplesare selected to determine the parameters of the CCLM.

33. The method of any of clauses 1-32, wherein the performing of theconversion includes generating the coded representation from the currentblock.

34. The method of any of clauses 1-32, wherein the performing of theconversion includes generating the current block from the codedrepresentation.

35. An apparatus in a video system comprising a processor and anon-transitory memory with instructions thereon, wherein theinstructions upon execution by the processor, cause the processor toimplement the method in any one of clauses 1 to 34.

36. A computer program product stored on a non-transitory computerreadable media, the computer program product including program code forcarrying out the method in any one of clauses 1 to 34.

The ninth set of clauses describe certain features and aspects of thedisclosed techniques listed in the previous section, including, forexample, Examples 16 and 17.

1. A method for video processing, comprising: determining, for aconversion between a current video block of a video that is a chromablock and a coded representation of the video, parameters ofcross-component linear model (CCLM) based on chroma samples that areselected based on W available above-neighboring samples, W being aninteger; and performing the conversion based on the determining.

2. The method of clause 1, wherein W is set to i) a width of the currentvideo block, ii) L times the width of the current video block, L beingan integer, iii) a sum of a height of the current video block and awidth of the current video block, or iv) a sum of the width of thecurrent video block and the number of available top-right neighboringsamples.

3. The method of clause 1, wherein W depends on an availability of atleast one of an above-neighboring block or a left-neighboring block ofthe current video block.

4. The method of clause 1, wherein W depends on a coding mode of thecurrent video block.

5. The method of clause 2, wherein L has a value depending on anavailability of a top-right block or a top left sample that is locatedadjacent to the current video block.

6. The method of clause 1, wherein the chroma samples are selected basedon a first position offset value (F) and a step value (S) that depend onW.

7. The method of clause 6, wherein a top left sample has a coordinate(x0, y0) and the selected chroma samples have coordinates (x0+F+K×S,y0−1), K being an integer between 0 and kMax.

8. The method of clause 6, wherein F=W/P or F=W/P+offset, P being aninteger.

9. The method of clause 8, wherein F=W>>(2+numIs4T), wherein numIs4T isequal to 1 in a case that there are four neighboring samples selectedwithin an above neighboring row and otherwise numIs4T is equal to 0.

10. The method of clause 6, wherein S=W/Q, Q being an integer.

11. The method of clause 6, wherein S is not less than 1.

12. The method of clause 10 or 11, wherein S=Max(1, W>>(1+numIs4T)),wherein numIs4T is equal to 1 in a case that there are four neighboringsamples selected within an above neighboring row and otherwise numIs4Tis equal to 0.

13. The method of clause 9 or 12, wherein numIs4T is equal to 1 in acase that above neighboring samples are available, left neighboringsamples are available, and the current video block is coded with anormal CCLM that is different from a first CCLM using onlyleft-neighboring samples, and different from a second CCLM using onlyabove-neighboring samples.

14. The method of clause 6, wherein F=S/R, R being an integer.

15. The method of clause 6, wherein S=F/Z, Z being an integer.

16. The method of any of clauses 7-15, wherein at least one of Kmax, F,S, or offset depends on a prediction mode of the current video blockthat is one of a first CCLM using only left-neighboring samples, asecond CCLM using only above-neighboring samples, a third CCLM usingboth left-neighboring and above-neighboring samples, or other modes thatare different from the first CCLM, the second CCLM, and the third CCLM.

17. The method of any of clauses 7-15, wherein at least one of Kmax, F,S, or offset depends on a width and/or a height of the current videoblock.

18. The method of any of clauses 7-15, wherein at least one of Kmax, F,S, or offset depends on availabilities of neighboring samples.

19. The method of any of clauses 7-15, wherein at least one of Kmax, F,S, or offset depends on W.

20. A method for video processing, comprising: determining, for aconversion between a current video block of a video that is a chromablock and a coded representation of the video, parameters ofcross-component linear model (CCLM) based on chroma samples that areselected based on H available left-neighboring samples of the currentvideo block; and performing the conversion based on the determining.

21. The method of clause 20, wherein H is set to one of i) a height ofthe current video block, ii) L times the height of the current videoblock, L being an integer, iii) a sum of a height of the current videoblock and a width of the current video block, or iv) a sum of the heightof the current video block and the number of available left-bottomneighboring samples.

22. The method of clause 20, wherein H depends on an availability of atleast one of an above-neighboring block or a left-neighboring block ofthe current video block.

23. The method of clause 20, wherein H depends on a coding mode of thecurrent video block.

24. The method of clause 21, wherein L has a value depending on anavailability of a below-left block or a below-left sample that islocated adjacent to the current video block.

25. The method of clause 20, wherein the chroma samples are selectedbased on a first position offset value (F) and a step value (S) thatdepend on H.

26. The method of clause 25, wherein a top-left sample has a coordinate(x0, y0) and the selected chroma samples have coordinates (x0−1,y0+F+K×S), K being an integer between 0 and kMax.

27. The method of clause 25, wherein F=H/P or F=H/P+offset, P being aninteger.

28. The method of clause 27, wherein F=H>>(2+numIs4L), wherein numIs4Lis equal to 1 in a case that there is four neighboring samples selectedwithin the left neighboring column; otherwise it is equal to 0.

29. The method of clause 25, wherein S=H/Q, Q being an integer.

30. The method of clause 25, wherein S is not less than 1.

31. The method of clause 29 or 30, wherein S=Max(1, H>>(1+numIs4L)),wherein numIs4L is equal to 1 in a case that there are four neighboringsamples selected within a left neighboring column and otherwise numIs4Lis equal to 0.

32. The method of clause 28 or 31, wherein numIs4L is equal to 1 in acase that above neighboring samples are available, left neighboringsamples are available, and the current video block is coded with anormal CCLM that is different from a first CCLM using onlyleft-neighboring samples, and different from a second CCLM using onlyabove-neighboring samples.

33. The method of clause 25, wherein F=S/R, R being an integer.

34. The method of clause 25, wherein S=F/Z, Z being an integer.

35. The method of any of clauses 26-34, wherein at least one of Kmax, F,S, or offset depends on a prediction mode of the current video blockthat is one of a first CCLM using only left-neighboring samples, asecond CCLM using only above-neighboring samples, a third CCLM usingboth left-neighboring and above-neighboring samples, or other modes thatare different from the first CCLM, the second CCLM, and the third CCLM.

36. The method of any of clauses 26-34, wherein at least one of Kmax, F,S, or offset depends on a width and/or a height of the current videoblock.

37. The method of any of clauses 26-34, wherein at least one of Kmax, F,S, or offset depends on H.

38. The method of any of clauses 26-34, wherein at least one of Kmax, F,S, or offset depends on availabilities of neighboring samples.

39. The method of clause 20, wherein H is set to a sum of the height ofthe current video block and a width of the current video block in a casethat an above-right neighboring block of the current video block isavailable.

40. The method of clause 20, wherein in a case that left neighboringsamples are unavailable, the selected chroma samples have the height Hregardless of whether the current video block has a first CCLM usingonly above-neighboring samples or not.

41. The method of clause 1, wherein W is set to a sum of the height ofthe current video block and a width of the current video block in a casethat a below-left neighboring block of the current video block isavailable.

42. The method of clause 1, wherein in a case that above neighboringsamples are unavailable, the selected chroma samples have the number ofW regardless of whether the current video block has a first CCLM usingonly left-neighboring samples or not.

43. The method of any of clauses 1-42, wherein the performing of theconversion includes generating the coded representation from the currentblock.

44. The method of any of clauses 1-42, wherein the performing of theconversion includes generating the current block from the codedrepresentation.

45. An apparatus in a video system comprising a processor and anon-transitory memory with instructions thereon, wherein theinstructions upon execution by the processor, cause the processor toimplement the method in any one of clauses 1 to 44.

46. A computer program product stored on a non-transitory computerreadable media, the computer program product including program code forcarrying out the method in any one of clauses 1 to 44.

The tenth set of clauses describe certain features and aspects of thedisclosed techniques listed in the previous section, including, forexample, Examples 18 and 19.

1. A method for video processing, comprising: determining, for aconversion between a current video block of a video that is a chromablock and a coded representation of the video, parameters of across-component linear model (CCLM) based on two or four chroma samplesand/or corresponding luma samples; and performing the conversion basedon the determining.

2. The method of clause 1, wherein the corresponding luma samples areobtained by down-sampling.

3. The method of clause 1, wherein the parameters of the CCLM includesmaxY/maxC and minY/minC.

4. The method of clause 3, wherein the two chroma samples are selectedto derive maxY/maxC and minY/minC, and wherein minY is set to be thesmaller luma sample value, minC is its corresponding chroma samplevalue, maxY is set to be the larger luma sample value, and maxC is itscorresponding chroma sample value.

5. The method of clause 3, wherein the four chroma samples are selectedto derive maxY/maxC and minY/minC, and wherein the four chroma samplesand the corresponding luma samples are divided into two arrays G0 andG1, each array including two chroma samples and their corresponding lumasamples.

6. The method of clause 5, wherein the two arrays G0 and G1 include oneof following sets:

-   -   i) G0={S0, S1}, G1={S2, S3},    -   ii) G0={S1, S0}, G1={S3, S2},    -   iii) G0={S0, S2}, G1={S1, S3},    -   iv) G0={S2, S0}, G1={S3, S1},    -   v) G0={S1, S2}, G1={S0, S3},    -   vi) G0={S2, S1}, G1={S3, S0},    -   vii) G0={S0, S3}, G1={S1, S2},    -   viii) G0={S3, S0}, G1={S2, S1},    -   ix) G0={S1, S3}, G1={S0, S2},    -   x) G0={S3, S1}, G1={S2, S0},    -   xi) G0={S3, S2}, G1={S0, S1}, or    -   xii) G0={S2, S3}, G1={S1, S0}, and

wherein S0, S1, S2, S3 include the four chroma samples, respectively,and further includes corresponding luma samples, respectively.

7. The method of clause 6, wherein upon a comparison of two luma samplevalues of G0[0] and G0[1], a chroma sample and its corresponding lumasample of G0[0] are swamped with those of G0[1].

8. The method of clause 7, wherein the chroma sample and itscorresponding luma sample of G0[0] are swamped with those of G0[1] in acase that a luma sample value of G0[0] is greater than a luma samplevalue of G0[1].

9. The method of clause 6, wherein upon a comparison of two luma samplevalues of G1[0] and G1[1], a chroma sample and its corresponding lumasample of G1[0] are swamped with those of G1[1].

10. The method of clause 9, wherein the chroma sample and itscorresponding luma sample of G1[0] are swamped with those of G1[1] in acase that a luma sample value of G1[0] is greater than a luma samplevalue of G1[1].

11. The method of clause 6, wherein upon a comparison of two luma samplevalues of G0[0] and G1[1], chroma samples and its corresponding lumasamples of G0[0] or G0[1] are swamped with those of G1[0] or G1[1].

12. The method of clause 11, wherein the chroma samples and itscorresponding luma samples of G0[0] or G0[1] are swamped with those ofG1[0] or G1[1] in a case that a luma sample value of G0[0] is greaterthan a luma sample value of G1[1].

13. The method of clause 6, wherein upon a comparison of two luma samplevalues of G0[1] and G1[0], a chroma sample and its corresponding lumasample of G0[1] are swamped with those of G1[0].

14. The method of clause 13, wherein the chroma sample and itscorresponding luma sample of G0[1] are swamped with those of G1[0] in acase that a luma sample value of G0[1] is greater than a luma samplevalue of G1[0].

15. The method of clause 6, wherein upon a comparison of two luma samplevalues of G0[0], G0[1], G1[0], and G1[1], following swamping operationsare conducted in an order: i) a swamping operation of a chroma sampleand its corresponding luma sample of G0[0] with those of G0[1], ii) aswamping operation of a chroma sample and its corresponding luma sampleof G1[0] with those of G1[1], iii) a swamping operation of chromasamples and its corresponding luma samples of G0[0] or G0[1] with thoseof G1[0] or G1[1], and iv) a swamping operation of a chroma sample andits corresponding luma sample of G0[1] with those of G1[0].

16. The method of clause 6, wherein maxY is calculated as an average ofluma sample values of G0[0] and G0[1] or an average of luma samplevalues of G1[0] and G1[1], and maxC is calculated as an average ofchroma sample values of G0[0] and G0[1] or an average of chroma samplevalues of G1[0] and G1[1].

17. The method of clause 6, wherein minY is calculated as an average ofluma sample values of G0[0] and G0[1] or an average of luma samplevalues of G1[0] and G1[1], and minC is calculated as an average ofchroma sample values of G0[0] and G0[1] or an average of chroma samplevalues of G1[0] and G1[1].

18. The method of clause 16 or 17, wherein the calculations of maxY andmaxC or the calculations of minY and minC are conducted after any one ofswamping operations that are performed upon a comparison of two lumasample values of G0[0], G0[1], G1[0] and G1[1], wherein the swampingoperations includes: i) a swamping operation of chroma sample and itscorresponding luma sample of G1[0] with those of G1[1], ii) a swampingoperation of chroma samples and its corresponding luma samples of G0[0]or G0[1] with those of G1[0] or G1[1], and iii) a swamping operation ofa chroma sample and its corresponding luma sample of G0[1] with those ofG1[0].

19. The method of clause 1, wherein in a case that there are only twochroma samples are available, a padding is performed on the twoavailable chroma samples to provide the four chroma samples.

20. The method of clause 19, wherein the four chroma samples include thetwo available chroma samples and two padding chroma samples that arecopied from the two available chroma samples.

21. The method of clause 6, wherein S0, S1, S2, S3 are chroma samplesand corresponding luma samples are selected in a given order within anabove row and/or a left column of the current video block.

22. A method for video processing, comprising: selecting, for aconversion between a current video block of a video that is a chromablock and a coded representation of the video, chroma samples based on aposition rule, the chroma samples used to derive parameters of across-component linear model (CCLM); and performing the conversion basedon the determining, wherein the position rule specifies to select thechroma samples that are located within an above row and/or a left columnof the current video block.

23. The method of clause 22, wherein the above row and the left columnhave W samples and H samples, respectively, W and H being a width and aheight of the current video block, respectively.

24. The method of clause 22, wherein the position rule is applied forthe current video block coded with a normal CCLM mode that is differentfrom a first CCLM mode that uses only above-neighboring samples toderive the CCLM and from a second CCLM mode that uses onlyleft-neighboring samples to derive the CCLM.

25. The method of clause 22, wherein the position rule specifies toselect the chroma samples that are located within the above row and anabove-right row of the current video block, and wherein the above rowand the above-right row have W samples and H samples, respectively, Wand H being a width and a height of the current video block,respectively.

26. The method of clause 25, wherein only available samples within theabove row and the above-right row are selected.

27. The method of clause 25, wherein the position rule is applied forthe current video block coded with a first CCLM mode that uses onlyabove-neighboring samples to derive the CCLM.

28. The method of clause 25, wherein the position rule is applied to acase that the above-row is available and the left column is unavailableand that the current video block is coded with a normal CCLM mode thatis different from a first CCLM mode that uses only above-neighboringsamples to derive the CCLM and from a second CCLM mode that uses onlyleft-neighboring samples to derive the CCLM.

29. The method of any of clauses 23-28, wherein numSampT is set based ona rule specifying that numSampT is set equal to nTbW in a case thatabove neighboring samples are available and numSampT is set equal to 0in a case that the above neighboring samples are not available, andwherein numSampT represents the number of chroma samples within an aboveneighboring row used to derive the parameters of a cross-componentlinear model and nTbW represents an width of the current video block.

30. The method of clause 29, wherein the rule is applied for the currentvideo block coded with a normal CCLM mode that is different from a firstCCLM mode that uses only above-neighboring samples to derive the CCLMand from a second CCLM mode that uses only left-neighboring samples toderive the CCLM.

31. The method of any of clauses 23-28, wherein numSampT is set based ona rule specifying that numSampT is set equal to nTbW+Min(numTopRight,nTbH) in a case that above neighboring samples are available and thecurrent video block is coded with a first CCLM mode that uses onlyabove-neighboring samples to derive the CCLM, and that otherwise thenumSampT is set equal to 0, and wherein numSampT represents the numberof chroma samples within an above neighboring row used to derive theparameters of the cross-component linear model, nTbW and nTbH representa width and a height of the current block, respectively, and numTopRightrepresents the number of available top right neighboring samples.

32. The method of clause 31, wherein the rule is applied for the currentvideo block not coded with a normal CCLM mode that is different from afirst CCLM mode that uses only above-neighboring samples to derive theCCLM and from a second CCLM mode that uses only left-neighboring samplesto derive the CCLM.

33. The method of clause 22, wherein the position rule specifies toselect the chroma samples that are located within the left column and abelow-left column of the current video block, and wherein the leftcolumn and the below-left column have H samples and W samples,respectively, W and H being a width and a height of the current videoblock, respectively.

34. The method of clause 33, wherein only available samples within theleft column and the below-left column are selected.

35. The method of clause 33, wherein the position rule is applied forthe current video block coded with a second CCLM mode that uses onlyleft-neighboring samples to derive the CCLM.

36. The method of clause 33, wherein the position rule is applied to acase that the above-row is unavailable and the left-column is availableand that the current video block is coded with a normal CCLM mode thatis different from a first CCLM mode that uses only above-neighboringsamples to derive the CCLM and from a second CCLM mode that uses onlyleft-neighboring samples to derive the CCLM.

37. The method of any of clauses 33-36, wherein numSampL is set based ona rule specifying that numSampL is set equal to nTbH in a case that leftneighboring samples are available and otherwise numSampL is set equal to0, and wherein numSampL represents the number of chroma samples within aleft neighbouring column used to derive parameters of thecross-component linear model and nTbH represents a height of the currentvideo block.

38. The method of clause 37, wherein the rule is applied for the currentvideo block coded with a normal CCLM mode that is different from a firstCCLM mode that uses only above-neighboring samples to derive the CCLMand from a second CCLM mode that uses only left-neighboring samples toderive the CCLM.

39. The method of any of clauses 33-36, wherein numSampL is set based ona rule specifying that numSampL is set equal to nTbH+Min(numLeftBelow,nTbW) in a case that left neighbouring samples are available and thecurrent video block is coded with a second CCLM mode that uses onlyleft-neighboring samples to derive the CCLM and that otherwise numSampLis set equal to 0, and wherein numSampL represents the number of chromasamples within a left neighboring column used to derive the parametersof the cross-component linear model, nTbW and nTbH represent a width anda height of the current block, respectively, and numLeftBelow representsthe number of available below-left neighboring samples.

40. The method of clause 39, wherein the rule is applied for the currentvideo block not coded with a normal CCLM mode that is different from afirst CCLM mode that uses only above-neighboring samples to derive theCCLM and from a second CCLM mode that uses only left-neighboring samplesto derive the CCLM.

41. The method of any of clauses 22-40, wherein luma samplescorresponding to selected chroma samples are used to derive theparameters of the cross-component linear model.

42. The method of clause 41, wherein the luma samples are derived bydownsampling.

43. The method of any of clauses 1-42, wherein the performing of theconversion includes generating the coded representation from the currentblock.

44. The method of any of clauses 1-42, wherein the performing of theconversion includes generating the current block from the codedrepresentation.

45. An apparatus in a video system comprising a processor and anon-transitory memory with instructions thereon, wherein theinstructions upon execution by the processor, cause the processor toimplement the method in any one of clauses 1 to 44.

46. A computer program product stored on a non-transitory computerreadable media, the computer program product including program code forcarrying out the method in any one of clauses 1 to 44.

The eleventh set of clauses describe certain features and aspects of thedisclosed techniques listed in the previous section, including, forexample, Examples 20, 21, 22.

1. A method for video processing, comprising: determining, for aconversion between a current video block of a video that is a chromablock and a coded representation of the video, positions at which lumasamples are downsampled, wherein the downsampled luma samples are usedto determine parameters of a cross-component linear model (CCLM) basedon chroma samples and downsampled luma samples, wherein the downsampledluma samples are at positions corresponding to positions of the chromasamples that are used to derive the parameters of the CCLM; andperforming the conversion based on the determining.

2. A method of clause 1, wherein luma samples are not downsampled at aposition which is out of the current video block and is not used todetermine the parameters of the CCLM.

3. A method for video processing, comprising: determining, for aconversion between a current video block of a video that is a chromablock and a coded representation of the video, a method to deriveparameters of a cross-component linear model (CCLM) using chroma samplesand luma samples based on a coding condition associated with the currentvideo block; and performing the conversion based on the determining.

4. The method of clause 3, wherein the coding condition corresponds to acolor format of the current video block.

5. The method of clause 4, wherein the color format is 4:2:0 or 4:4:4.

6. The method of clause 3, wherein coding condition corresponds to acolor representation method of the current video block.

7. The method of clause 6, wherein the color representation method is aRGB or YCbCr.

8. The method of clause 3, wherein the chroma samples are downsampledand the determining depends on locations of downsampled chroma samples.

9. The method of clause 3, wherein the method to derive parameterscomprises determining the parameters of the CCLM based on the chromasamples and the luma samples that are selected from a group ofneighboring chroma samples based on a position rule.

10. The method of clause 3, wherein the method to derive parameterscomprises determining the parameters of the CCLM based on maximum andminimum values of the chroma samples and the luma samples.

11. The method of clause 3, wherein the method to derive parameterscomprises determining the parameters of the CCLM that are completelydeterminable by two chroma samples and corresponding two luma samples.

12. The method of clause 3, wherein the method to derive parameterscomprises determining the parameters of the CCLM using a parameter tablewhose entries are retrieved according to two chroma sample values andtwo luma sample values.

13. A method for video processing, comprising: determining, for aconversion between a current video block of a video that is a chromablock and a coded representation of the video, whether to derive maximumvalues and/or minimum values of a luma component and a chroma componentthat are used to derive parameters of a cross-component linear model(CCLM) based on availability of a left-neighboring block and anabove-neighboring block of the current video block; and performing theconversion based on the determining.

14. The method of clause 13, wherein the maximum values and/or theminimum values are not derived in a case that the left-neighboring blockand the above-neighboring block are unavailable.

15. The method of clause 13, wherein the determining determines based ona number of available neighboring samples of the current video block,and wherein the available neighboring samples are used to derive theparameters of the cross-component linear model.

16. The method of clause 15, wherein the maximum values and/or theminimum values are not derived in a case of numSampL==0 and numSampT==0,the numSampL and the numSampT indicating a number of availableneighboring samples from the left-neighboring block and a number ofavailable neighboring samples from the above-neighboring block,respectively, and wherein the available neighboring samples from theleft-neighboring block and the available neighboring samples from theabove-neighboring bock are used to derive the parameters of thecross-component linear model.

17. The method of clause 15, wherein the maximum values and/or theminimum values are not derived in a case of numSampL+numSampT==0, thenumSampL and the numSampT indicating a number of available neighboringsamples from the left-neighboring block and a number of availableneighboring samples from the above-neighboring block, respectively, andwherein the available neighboring samples from the left-neighboringblock and the available neighboring samples from the above-neighboringbock are used to derive the parameters of the cross-component linearmodel.

18. The method of any of clauses 1-17, wherein the performing of theconversion includes generating the coded representation from the currentblock.

19. The method of any of clauses 1-17, wherein the performing of theconversion includes generating the current block from the codedrepresentation.

20. An apparatus in a video system comprising a processor and anon-transitory memory with instructions thereon, wherein theinstructions upon execution by the processor, cause the processor toimplement the method in any one of clauses 1 to 19.

21. A computer program product stored on a non-transitory computerreadable media, the computer program product including program code forcarrying out the method in any one of clauses 1 to 19.

The twelfth set of clauses describe certain features and aspects of thedisclosed techniques listed in the previous section, including, forexample, Example 23.

1. A method for video processing, comprising: determining, for aconversion between a current video block of a video and a codedrepresentation of the video, parameters of a coding tool using a linearmodel based on selected neighboring samples of the current video blockand corresponding neighboring samples of a reference block; andperforming the conversion based on the determining.

2. The method of clause 1, wherein the coding tool is a localillumination compensation (LIC) tool that includes using a linear modelof illumination changes in the current video block during theconversion.

3. The method of clause 2, wherein the neighboring samples of thecurrent video block and the neighboring samples of the reference blockare selected based on a position rule.

4. The method of clause 2, wherein the parameters of the coding tool aredetermined based on maximum and minimum values of the neighboringsamples of the current video block and the neighboring samples of thereference block.

5. The method of clause 2, wherein the parameters of the coding tool aredetermined using a parameter table whose entries are retrieved accordingto two neighboring samples of the current video block and twoneighboring samples of the reference block.

6. The method of clause 2, wherein the neighboring samples of thecurrent video block and the neighboring samples of the reference blockare downsampled to derive the parameters of the coding tool.

7. The method of clause 2, wherein the neighboring samples used toderive parameters of the LIC tool excludes samples at certain positionsin an above row and/or a left column of the current video block.

8. The method of clause 2, wherein a top-left sample of the currentvideo block has coordinates with (x0, y0), a sample with coordinates(x0, y0−1) is not used to derive parameters of the LIC tool.

9. The method of clause 2, wherein a top-left sample of the currentvideo block has coordinates with (x0, y0), a sample with coordinates(x0−1, y0) is not used to derive parameters of the LIC tool.

10. The method of clause 7, wherein the certain positions depend on anavailability of the above row and/or the left column.

11. The method of clause 7, wherein the certain positions depend on ablock dimension of the current video block.

12. The method of clause 1, wherein the determining depends on anavailability of the above row and/or the left column.

13. The method of clause 2, wherein N neighboring samples of the currentvideo block and N neighboring samples of the reference block are used toderive the parameters of the LIC tool.

14. The method of clause 13, wherein N is 4.

15. The method of clause 13, wherein N neighboring samples of thecurrent video block includes N/2 samples from an above row of thecurrent video block and N/2 samples from a left column of the currentvideo block.

16. The method of clause 13, wherein N is equal to min (L, T), T being atotal number of available neighboring samples of the current video blockand L being an integer.

17. The method of clause 13, wherein the N neighboring samples areselected based on a same rule that is applicable to select samples toderive parameters of the CCLM.

18. The method of clause 13, wherein N neighboring samples are selectedbased on a same rule that is applicable to select samples to deriveparameters of a first mode of the CCLM that uses above-neighboringsamples only.

19. The method of clause 13, wherein N neighboring samples are selectedbased on a same rule that is applicable to select samples to deriveparameters of a second mode of the CCLM that uses left-neighboringsamples only.

20. The method of clause 13, wherein the N neighboring samples of thecurrent video block are selected based on availabilities of an above rowor a left column of the current video block.

21. A method for video processing, comprising: determining, for aconversion between a current video block of a video and a codedrepresentation of the video, parameters of a local illuminationcompensation (LIC) tool based on N neighboring samples of the currentvideo block and N corresponding neighboring samples of a referenceblock, wherein the N neighboring samples of the current video block areselected based on positions of the N neighboring samples; and performingthe conversion based on the determining, wherein the LIC tool uses alinear model of illumination changes in the current video block duringthe conversion.

22. The method of clause 21, wherein the N neighboring samples of thecurrent video block are selected based on a width and a height of thecurrent video block.

23. The method of clause 21, wherein the N neighboring samples of thecurrent video block are selected based on availabilities of neighboringblocks of the current video block.

24. The method of clause 21, wherein the N neighboring samples of thecurrent video block are selected with a first position offset value (F)and a step value (S) that depend on a dimension of the current videoblock and availabilities of neighboring blocks.

25. The method of any of clauses 1-24, wherein the current video blockis affine-coded.

26. A method for video processing, comprising: determining, for aconversion between a current video block of a video that is a chromablock and a coded representation of the video, parameters of across-component linear model (CCLM) based on chroma samples andcorresponding luma samples; and performing the conversion based on thedetermining, wherein some of the chroma samples are obtained by apadding operation and the chroma samples and the corresponding lumasamples are grouped into two arrays G0 and G1, each array including twochroma samples and corresponding luma samples.

27. The method of clause 26, wherein in a case that a sum of cntT andcntL is equal to 2, following operations are performed in an order: i)pSelComp[3] is set equal to pSelComp[0], ii) pSelComp[2] is set equal topSelComp[1], iii) pSelComp[0] is set equal to pSelComp[1], and iv)pSelComp[1] is set equal to pSelComp[3], wherein cntT and cntL indicatethe number of samples selected from an above neighboring block and aleft neighboring block, respectively, and wherein pSelComp[0] topSelComp[3] indicate pixel values of color components of correspondingsamples that are selected.

28. The method of clause 26, wherein the determining of the parametersincludes initializing values of G0[0], G0[1], G1[0], and G1[1].

29. The method of clause 28, wherein G0[0]=0, G0[1]=2, G1[0]=1, andG1[1]=3.

30. The method of clause 28, wherein the determining of the parametersfurther includes, after the initializing of the values, upon acomparison of two luma sample values of G0[0] and G0[1], swamping achroma sample and its corresponding luma sample of G0[0] with those ofG0[1].

31. The method of clause 30, wherein a chroma sample and itscorresponding luma sample of G0[0] are swamped with those of G0[1] in acase that a luma sample value of G0[0] is greater than a luma samplevalue of G0[1].

32. The method of clause 28, wherein the determining of the parametersfurther includes, after the initializing of the values, upon acomparison of two luma sample values of G1[0] and G1[1], swamping achroma sample and its corresponding luma sample of G1[0] with those ofG1[1].

33. The method of clause 32, wherein a chroma sample and itscorresponding luma sample of G1[0] are swamped with those of G1[1] in acase that a luma sample value of G1[0] is greater than a luma samplevalue of G1[1].

34. The method of clause 28, wherein the determining of the parametersfurther includes, after the initializing of the values, upon acomparison of two luma sample values of G0[0] and G1[1], swamping chromasamples and its corresponding luma samples of G0[0] or G0[1] with thoseof G1[0] or G1[1].

35. The method of clause 34, wherein chroma samples and itscorresponding luma samples of G0[0] or G0[1] are swamped with those ofG1[0] or G1[1] in a case that a luma sample value of G0[0] is greaterthan a luma sample value of G1[1].

36. The method of clause 28, wherein the determining of the parametersfurther includes, after the initializing of the values, upon acomparison of two luma sample values of G0[1] and G1[0], swamping achroma sample and its corresponding luma sample of G0[1] with those ofG1[0].

37. The method of clause 36, wherein a chroma sample and itscorresponding luma sample of G0[1] are swamped with those of G1[0] in acase that a luma sample value of G0[1] is greater than a luma samplevalue of G1[0].

38. The method of clause 28, wherein the determining of the parametersfurther includes, after the initializing of the values, upon acomparison of two luma sample values of G0[0], G0[1], G1[0], and G1[1],performing following swamping operations in an order: i) a swampingoperation of chroma sample and its corresponding luma sample of G0[0]with those of G0[1], ii) a swamping operation of chroma sample and itscorresponding luma sample of G1[0] with those of G1[1], iii) a swampingoperation of chroma samples and its corresponding luma samples of G0[0]or G0[1] with those of G1[0] or G1[1], and iv) a swamping operation of achroma sample and its corresponding luma sample of G0[1] with those ofG1[0].

39. The method of any of clauses 1-38, wherein the performing of theconversion includes generating the coded representation from the currentblock.

40. The method of any of clauses 1-38, wherein the performing of theconversion includes generating the current block from the codedrepresentation.

41. An apparatus in a video system comprising a processor and anon-transitory memory with instructions thereon, wherein theinstructions upon execution by the processor, cause the processor toimplement the method in any one of clauses 1 to 40.

42. A computer program product stored on a non-transitory computerreadable media, the computer program product including program code forcarrying out the method in any one of clauses 1 to 40.

From the foregoing, it will be appreciated that specific embodiments ofthe presently disclosed technology have been described herein forpurposes of illustration, but that various modifications may be madewithout deviating from the scope of the invention. Accordingly, thepresently disclosed technology is not limited except as by the appendedclaims.

Implementations of the subject matter and the functional operationsdescribed in this patent document can be implemented in various systems,digital electronic circuitry, or in computer software, firmware, orhardware, including the structures disclosed in this specification andtheir structural equivalents, or in combinations of one or more of them.Implementations of the subject matter described in this specificationcan be implemented as one or more computer program products, i.e., oneor more modules of computer program instructions encoded on a tangibleand non-transitory computer readable medium for execution by, or tocontrol the operation of, data processing apparatus. The computerreadable medium can be a machine-readable storage device, amachine-readable storage substrate, a memory device, a composition ofmatter effecting a machine-readable propagated signal, or a combinationof one or more of them. The term “data processing unit” or “dataprocessing apparatus” encompasses all apparatus, devices, and machinesfor processing data, including by way of example a programmableprocessor, a computer, or multiple processors or computers. Theapparatus can include, in addition to hardware, code that creates anexecution environment for the computer program in question, e.g., codethat constitutes processor firmware, a protocol stack, a databasemanagement system, an operating system, or a combination of one or moreof them.

A computer program (also known as a program, software, softwareapplication, script, or code) can be written in any form of programminglanguage, including compiled or interpreted languages, and it can bedeployed in any form, including as a stand-alone program or as a module,component, subroutine, or other unit suitable for use in a computingenvironment. A computer program does not necessarily correspond to afile in a file system. A program can be stored in a portion of a filethat holds other programs or data (e.g., one or more scripts stored in amarkup language document), in a single file dedicated to the program inquestion, or in multiple coordinated files (e.g., files that store oneor more modules, sub programs, or portions of code). A computer programcan be deployed to be executed on one computer or on multiple computersthat are located at one site or distributed across multiple sites andinterconnected by a communication network.

The processes and logic flows described in this specification can beperformed by one or more programmable processors executing one or morecomputer programs to perform functions by operating on input data andgenerating output. The processes and logic flows can also be performedby, and apparatus can also be implemented as, special purpose logiccircuitry, e.g., an FPGA (field programmable gate array) or an ASIC(application specific integrated circuit).

Processors suitable for the execution of a computer program include, byway of example, both general and special purpose microprocessors, andany one or more processors of any kind of digital computer. Generally, aprocessor will receive instructions and data from a read only memory ora random access memory or both. The essential elements of a computer area processor for performing instructions and one or more memory devicesfor storing instructions and data. Generally, a computer will alsoinclude, or be operatively coupled to receive data from or transfer datato, or both, one or more mass storage devices for storing data, e.g.,magnetic, magneto optical disks, or optical disks. However, a computerneed not have such devices. Computer readable media suitable for storingcomputer program instructions and data include all forms of nonvolatilememory, media and memory devices, including by way of examplesemiconductor memory devices, e.g., EPROM, EEPROM, and flash memorydevices. The processor and the memory can be supplemented by, orincorporated in, special purpose logic circuitry.

It is intended that the specification, together with the drawings, beconsidered exemplary only, where exemplary means an example. As usedherein, the use of “or” is intended to include “and/or”, unless thecontext clearly indicates otherwise.

While this patent document contains many specifics, these should not beconstrued as limitations on the scope of any invention or of what may beclaimed, but rather as descriptions of features that may be specific toparticular embodiments of particular inventions. Certain features thatare described in this patent document in the context of separateembodiments can also be implemented in combination in a singleembodiment. Conversely, various features that are described in thecontext of a single embodiment can also be implemented in multipleembodiments separately or in any suitable subcombination. Moreover,although features may be described above as acting in certaincombinations and even initially claimed as such, one or more featuresfrom a claimed combination can in some cases be excised from thecombination, and the claimed combination may be directed to asubcombination or variation of a subcombination.

Similarly, while operations are depicted in the drawings in a particularorder, this should not be understood as requiring that such operationsbe performed in the particular order shown or in sequential order, orthat all illustrated operations be performed, to achieve desirableresults. Moreover, the separation of various system components in theembodiments described in this patent document should not be understoodas requiring such separation in all embodiments.

Only a few implementations and examples are described and otherimplementations, enhancements and variations can be made based on whatis described and illustrated in this patent document.

What is claimed is:
 1. A video coding method, comprising: determining,for a conversion between a current video block of a video that is achroma block and a bitstream of the video, parameters of across-component linear model (CCLM) at least based on two or more chromasamples from neighboring chroma samples of the current video block,wherein the two or more chroma samples are selected based on a CCLM modeof the current video block and availabilities of the neighboring chromasamples; applying the CCLM on luma samples located in a luma blockcorresponding to the current video block to derive prediction values ofthe current video block; and performing the conversion based on theprediction values, wherein the CCLM mode is one of a first CCLM mode, asecond CCLM mode, or a third CCLM mode, wherein in the second CCLM mode,the parameters of the CCLM are derived based on left neighboring chromasamples and below-left neighboring chroma samples, wherein in the thirdCCLM mode, the parameters of the CCLM are derived based on aboveneighboring chroma samples and above-right neighboring chroma samples,wherein in the second CCLM mode, two chroma samples are selected fromthe left neighboring chroma samples and other two chroma samples areselected from the below-left neighboring chroma samples in response toboth the left neighboring chroma samples and the below-left neighboringchroma samples being available, wherein in the third CCLM mode, twochroma samples are selected from the above neighboring chroma samplesand other two chroma samples are selected from the above-rightneighboring chroma samples in response to both the above neighboringchroma samples and the above-right neighboring chroma samples beingavailable, wherein when the CCLM mode is the first CCLM mode, two chromasamples are selected from the left neighboring chroma samples and othertwo chroma samples are selected from the above neighboring chromasamples in response to both the left neighboring chroma samples and theabove neighboring chroma samples being available, wherein in the firstCCLM mode, exactly two chroma samples are selected from the aboveneighboring chroma samples in response to only the above neighboringchroma samples being available and a width of the current video blockbeing equal to 2, and wherein in the first CCLM mode, exactly fourchroma samples are selected from the above neighboring chroma samples inresponse to only the above neighboring chroma samples being availableand the width of the current video block being larger than
 2. 2. Themethod of claim 1, wherein in the first CCLM mode, exactly two chromasamples are selected from the left neighboring chroma samples inresponse to only the left neighboring chroma samples being available anda height of the current video block being equal to
 2. 3. The method ofclaim 1, wherein in the first CCLM mode, exactly four chroma samples areselected from the left neighboring chroma samples in response to onlythe left neighboring chroma samples being available and a height of thecurrent video block being larger than
 2. 4. The method of claim 1,wherein in the second CCLM mode, exactly two chroma samples are selectedfrom the left neighboring chroma samples in response to only the leftneighboring chroma samples being available and a height of the currentvideo block being equal to
 2. 5. The method of claim 1, wherein in thesecond CCLM mode, exactly four chroma samples are selected from the leftneighboring chroma samples in response to only the left neighboringchroma samples being available and a height of the current video blockbeing larger than
 2. 6. The method of claim 1, wherein in the third CCLMmode, exactly two chroma samples are selected from the above neighboringchroma samples in response to only the above neighboring chroma samplesbeing available and the width of the current video block being equal to2.
 7. The method of claim 1, wherein in the third CCLM mode, exactlyfour chroma samples are selected from the above neighboring chromasamples in response to only the above neighboring chroma samples beingavailable and the width of the current video block being larger than 2.8. The method of claim 1, further comprising determining two or moreluma samples corresponding the two or more chroma samples.
 9. The methodof claim 8, wherein in response to four luma samples being determined, afirst averaging luma value is derived based on averaging two maximumvalues of the four luma samples, and a second averaging luma value isderived based on averaging two minimum values of the four luma samples,respectively.
 10. The method of claim 9, wherein the first averagingluma value and the second averaging luma value are used to derive theparameters of the CCLM.
 11. The method of claim 1, wherein theperforming of the conversion includes decoding the current video blockfrom the bitstream.
 12. The method of claim 1, wherein the performing ofthe conversion includes encoding the current block into the bitstream.13. A video coding apparatus comprising a processor and a non-transitorymemory with instructions thereon, wherein the instructions uponexecution by the processor, cause the processor to: determine, for aconversion between a current video block of a video that is a chromablock and a bitstream of the video, parameters of a cross-componentlinear model (CCLM) at least based on two or more chroma samples fromneighboring chroma samples of the current video block, wherein the twoor more chroma samples are selected based on a CCLM mode of the currentvideo block and availabilities of the neighboring chroma samples; applythe CCLM on luma samples located in a luma block corresponding to thecurrent video block to derive prediction values of the current videoblock; and perform the conversion based on the prediction values,wherein the CCLM mode is one of a first CCLM mode, a second CCLM mode,or a third CCLM mode, wherein in the second CCLM mode, the parameters ofthe CCLM are derived based on left neighboring chroma samples andbelow-left neighboring chroma samples, wherein in the third CCLM mode,the parameters of the CCLM are derived based on above neighboring chromasamples and above-right neighboring chroma samples, wherein in thesecond CCLM mode, two chroma samples are selected from the leftneighboring chroma samples and other two chroma samples are selectedfrom the below-left neighboring chroma samples in response to both theleft neighboring chroma samples and the below-left neighboring chromasamples being available, wherein in the third CCLM mode, two chromasamples are selected from the above neighboring chroma samples and othertwo chroma samples are selected from the above-right neighboring chromasamples in response to both the above neighboring chroma samples and theabove-right neighboring chroma samples being available, wherein when theCCLM mode is the first CCLM mode, two chroma samples are selected fromthe left neighboring chroma samples and other two chroma samples areselected from the above neighboring chroma samples in response to boththe left neighboring chroma samples and the above neighboring chromasamples being available, wherein in the first CCLM mode, exactly twochroma samples are selected from the above neighboring chroma samples inresponse to only the above neighboring chroma samples being availableand a width of the current video block being equal to 2, and wherein inthe first CCLM mode, exactly four chroma samples are selected from theabove neighboring chroma samples in response to only the aboveneighboring chroma samples being available and the width of the currentvideo block being larger than
 2. 14. The video coding apparatus of claim13, wherein in the first CCLM mode, exactly two chroma samples areselected from the left neighboring chroma samples in response to onlythe left neighboring chroma samples being available and a height of thecurrent video block being equal to 2; and wherein in the first CCLMmode, exactly four chroma samples are selected from the left neighboringchroma samples in response to only the left neighboring chroma samplesbeing available and the height of the current video block being largerthan
 2. 15. The video coding apparatus of claim 13, wherein in thesecond CCLM mode, exactly two chroma samples are selected from the leftneighboring chroma samples in response to only the left neighboringchroma samples being available and a height of the current video blockbeing equal to 2; and wherein in the second CCLM mode, exactly fourchroma samples are selected from the left neighboring chroma samples inresponse to only the left neighboring chroma samples being available anda height of the current video block being larger than
 2. 16. The videocoding apparatus of claim 13, wherein in the third CCLM mode, exactlytwo chroma samples are selected from the above neighboring chromasamples in response to only the above neighboring chroma samples beingavailable and the width of the current video block being equal to 2; andwherein in the third CCLM mode, exactly four chroma samples are selectedfrom the above neighboring chroma samples in response to only the aboveneighboring chroma samples being available and the width of the currentvideo block being larger than
 2. 17. A non-transitory computer-readablestorage medium storing instruction that cause a processor to: determine,for a conversion between a current video block of a video that is achroma block and a bitstream of the video, parameters of across-component linear model (CCLM) at least based on two or more chromasamples from neighboring chroma samples of the current video block,wherein the two or more chroma samples are selected based on a CCLM modeof the current video block and availabilities of the neighboring chromasamples; apply the CCLM on luma samples located in a luma blockcorresponding to the current video block to derive prediction values ofthe current video block; and perform the conversion based on theprediction values, wherein the CCLM mode is one of a first CCLM mode, asecond CCLM mode, or a third CCLM mode, wherein in the second CCLM mode,the parameters of the CCLM are derived based on left neighboring chromasamples and below-left neighboring chroma samples, wherein in the thirdCCLM mode, the parameters of the CCLM are derived based on aboveneighboring chroma samples and above-right neighboring chroma samples,wherein in the second CCLM mode, two chroma samples are selected fromthe left neighboring chroma samples and other two chroma samples areselected from the below-left neighboring chroma samples in response toboth the left neighboring chroma samples and the below-left neighboringchroma samples being available, wherein in the third CCLM mode, twochroma samples are selected from the above neighboring chroma samplesand other two chroma samples are selected from the above-rightneighboring chroma samples in response to both the above neighboringchroma samples and the above-right neighboring chroma samples beingavailable, wherein when the CCLM mode is the first CCLM mode, two chromasamples are selected from the left neighboring chroma samples and othertwo chroma samples are selected from the above neighboring chromasamples in response to both the left neighboring chroma samples and theabove neighboring chroma samples being available, wherein in the firstCCLM mode, exactly two chroma samples are selected from the aboveneighboring chroma samples in response to only the above neighboringchroma samples being available and a width of the current video blockbeing equal to 2, and wherein in the first CCLM mode, exactly fourchroma samples are selected from the above neighboring chroma samples inresponse to only the above neighboring chroma samples being availableand the width of the current video block being larger than
 2. 18. Thenon-transitory computer-readable storage medium of claim 17, wherein inthe first CCLM mode, exactly two chroma samples are selected from theleft neighboring chroma samples in response to only the left neighboringchroma samples being available and a height of the current video blockbeing equal to 2; and wherein in the first CCLM mode, exactly fourchroma samples are selected from the left neighboring chroma samples inresponse to only the left neighboring chroma samples being available andthe height of the current video block being larger than
 2. 19. Anon-transitory computer-readable recording medium storing a bitstream ofa video which is generated by a method by a video processing apparatus,wherein the method comprises: determining parameters of across-component linear model (CCLM) at least based on two or more chromasamples from neighboring chroma samples of a current video block of thevideo that is a chroma block, wherein the two or more chroma samples areselected based on a CCLM mode of the current video block andavailabilities of the neighboring chroma samples; applying the CCLM onluma samples located in a luma block corresponding to the current videoblock to derive prediction values of the current video block; andgenerating the bitstream based on the prediction values, wherein theCCLM mode is one of a first CCLM mode, a second CCLM mode, or a thirdCCLM mode, wherein in the second CCLM mode, the parameters of the CCLMare derived based on left neighboring chroma samples and below-leftneighboring chroma samples, wherein in the third CCLM mode, theparameters of the CCLM are derived based on above neighboring chromasamples and above-right neighboring chroma samples, wherein in thesecond CCLM mode, two chroma samples are selected from the leftneighboring chroma samples and other two chroma samples are selectedfrom the below-left neighboring chroma samples in response to both theleft neighboring chroma samples and the below-left neighboring chromasamples being available, wherein in the third CCLM mode, two chromasamples are selected from the above neighboring chroma samples and othertwo chroma samples are selected from the above-right neighboring chromasamples in response to both the above neighboring chroma samples and theabove-right neighboring chroma samples being available, wherein when theCCLM mode is the first CCLM mode, two chroma samples are selected fromthe left neighboring chroma samples and other two chroma samples areselected from the above neighboring chroma samples in response to boththe left neighboring chroma samples and the above neighboring chromasamples being available, wherein in the first CCLM mode, exactly twochroma samples are selected from the above neighboring chroma samples inresponse to only the above neighboring chroma samples being availableand a width of the current video block being equal to 2, and wherein inthe first CCLM mode, exactly four chroma samples are selected from theabove neighboring chroma samples in response to only the aboveneighboring chroma samples being available and the width of the currentvideo block being larger than
 2. 20. The non-transitorycomputer-readable recording medium of claim 19, wherein in the firstCCLM mode, exactly two chroma samples are selected from the leftneighboring chroma samples in response to only the left neighboringchroma samples being available and a height of the current video blockbeing equal to 2; and wherein in the first CCLM mode, exactly fourchroma samples are selected from the left neighboring chroma samples inresponse to only the left neighboring chroma samples being available andthe height of the current video block being larger than 2.